Skip to content

Commit 14c53e2

Browse files
committed
fix: integration test expecting createdAt resolution to match up with expected
1 parent 95af2a0 commit 14c53e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/java/uk/gov/hmcts/cp/subscription/integration/SubscriptionUpdateControllerIntegrationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import uk.gov.hmcts.cp.subscription.entities.ClientSubscriptionEntity;
88
import uk.gov.hmcts.cp.subscription.model.EntityEventType;
99

10+
import java.time.format.DateTimeFormatter;
1011
import java.util.List;
1112

1213
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
@@ -24,6 +25,7 @@ void beforeEach() {
2425
@Test
2526
void update_client_subscription_should_update_subscription() throws Exception {
2627
ClientSubscriptionEntity existing = insertSubscription("https://oldendpoint", List.of(EntityEventType.PCR));
28+
String existingCreatedAt = existing.getCreatedAt().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
2729
String body = new ObjectMapper().writeValueAsString(request);
2830
mockMvc.perform(put("/client-subscriptions/{id}", existing.getId())
2931
.contentType(MediaType.APPLICATION_JSON)
@@ -35,6 +37,6 @@ void update_client_subscription_should_update_subscription() throws Exception {
3537
.andExpect(jsonPath("$.eventTypes.[0]").value("CUSTODIAL_RESULT"))
3638
.andExpect(jsonPath("$.eventTypes.[1]").value("PCR"))
3739
.andExpect(jsonPath("$.notificationEndpoint.webhookUrl").value("https://my-callback-url"))
38-
.andExpect(jsonPath("$.createdAt").value(existing.getCreatedAt().toString()));
40+
.andExpect(jsonPath("$.createdAt").value(existingCreatedAt + "Z"));
3941
}
4042
}

0 commit comments

Comments
 (0)