Skip to content

Commit

Permalink
TMI2-725 - Remove Contentful slug when unpublishing an advert
Browse files Browse the repository at this point in the history
  • Loading branch information
jpurvis-and committed Mar 26, 2024
1 parent 88d3f17 commit 66d6f8c
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 @@ -319,6 +319,7 @@ public void unpublishAdvert(UUID advertId) {

contentfulManagementClient.entries().unPublish(contentfulAdvert);
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 @@ -1044,6 +1044,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 @@ -1071,6 +1072,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 66d6f8c

Please sign in to comment.