Skip to content

Commit

Permalink
TMI2-725 - Remove Contentful slug when unpublishing an advert (#264)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Purvis <[email protected]>
  • Loading branch information
jimpurvisTCO and jpurvis-and authored Mar 26, 2024
1 parent 732ee02 commit 2eb1c5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ public void unpublishAdvert(UUID advertId) {
}

advert.setStatus(GrantAdvertStatus.DRAFT);
advert.setContentfulSlug(null);
advert.setUnpublishedDate(Instant.now());

save(advert);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,7 @@ void unpublishAdvert_UnpublishesAdvertFromContentful_AndSetsStatusToDraftInDb()
assertThat(advertCaptor.getValue().getId()).isEqualTo(grantAdvertId);
assertThat(advertCaptor.getValue().getStatus()).isEqualTo(GrantAdvertStatus.DRAFT);
assertThat(advertCaptor.getValue().getUnpublishedDate()).isNotNull();
assertThat(advertCaptor.getValue().getContentfulSlug()).isNull();
}

@Test
Expand Down Expand Up @@ -1097,6 +1098,7 @@ void unpublishAdvertThroughLambda_successfullyUnpublishedAdvert() {
assertThat(advertCaptor.getValue().getId()).isEqualTo(grantAdvertId);
assertThat(advertCaptor.getValue().getStatus()).isEqualTo(GrantAdvertStatus.DRAFT);
assertThat(advertCaptor.getValue().getUnpublishedDate()).isNotNull();
assertThat(advertCaptor.getValue().getContentfulSlug()).isNull();
}

}
Expand Down

0 comments on commit 2eb1c5b

Please sign in to comment.