11package uk .gov .pay .ledger .agreement .resource ;
22
3+ import jakarta .ws .rs .core .Response ;
34import org .json .JSONObject ;
45import org .junit .jupiter .api .BeforeEach ;
56import org .junit .jupiter .api .Test ;
1415import uk .gov .service .payments .commons .model .agreement .AgreementStatus ;
1516import uk .gov .service .payments .commons .model .agreement .PaymentInstrumentType ;
1617
17- import jakarta .ws .rs .core .Response ;
1818import java .time .ZoneOffset ;
1919import java .time .ZonedDateTime ;
2020
2121import static io .restassured .RestAssured .given ;
2222import static io .restassured .http .ContentType .JSON ;
2323import static org .hamcrest .CoreMatchers .is ;
24- import static org .hamcrest .CoreMatchers .notNullValue ;
2524import static org .hamcrest .Matchers .containsString ;
2625import static org .hamcrest .Matchers .nullValue ;
2726import static uk .gov .pay .ledger .agreement .resource .AgreementSearchParams .DEFAULT_DISPLAY_SIZE ;
@@ -483,11 +482,12 @@ void shouldGetAgreementEvents_shouldReturn404WhenServiceIdIncorrect() {
483482 @ Test
484483 void shouldGetCancelledByUserAgreementWithEmailAndDate () {
485484 var serviceId = "a-valid-service-id" ;
485+ ZonedDateTime now = ZonedDateTime .now (ZoneOffset .UTC );
486486 var fixture = AgreementFixture .anAgreementFixture ()
487487 .withExternalId ("a-valid-agreement-id" )
488488 .withServiceId (serviceId )
489489 .withUserIdentifier ("a-valid-user-identifier" )
490- .withCancelledDate (ZonedDateTime .now ( ZoneOffset . UTC ))
490+ .withCancelledDate (ZonedDateTime .parse ( "2026-01-12T16:12:34.123456789Z" ))
491491 .withCancelledByUserEmail ("jdoe@example.org" )
492492 .withStatus (AgreementStatus .CANCELLED )
493493 .insert (rule .getJdbi ());
@@ -502,7 +502,7 @@ void shouldGetCancelledByUserAgreementWithEmailAndDate() {
502502 .body ("external_id" , is (fixture .getExternalId ()))
503503 .body ("user_identifier" , is ("a-valid-user-identifier" ))
504504 .body ("cancelled_by_user_email" , is ("jdoe@example.org" ))
505- .body ("cancelled_date" , is (notNullValue () ));
505+ .body ("cancelled_date" , is ("2026-01-12T16:12:34.123Z" ));
506506 }
507507
508508 private void prepareAgreementsForService (String serviceId , int numberOfAgreements ) {
0 commit comments