Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,6 @@ public void shouldAddInformantRegisterRequestWithVerdictAndExposeItInProsecutorR
helper.verifyInformantRegisterIsNotified(prosecutionAuthorityId);
}

@Test
public void shouldRejectInformantRegisterWithVerdictCodeButNoVerdictDate() throws IOException {
// T071 / FR-004: verdict.json `dependencies` makes verdictCode and verdictDate co-dependent.
// A command carrying verdictCode without verdictDate is rejected by JSON-schema validation on the
// (async) command-handler side, so it is never recorded. Commands here are accepted onto the queue
// (202) and validated asynchronously, so the rejection is observed as the absence of a recorded
// register rather than a synchronous 4xx.
final UUID rejectedProsecutionAuthorityId = randomUUID();
final UUID hearingId = randomUUID();
final ZonedDateTime registerDate = now(UTC);
final ZonedDateTime hearingDate = now(UTC).minusHours(1);
final String prosecutionAuthorityCode = STRING.next();

final Response writeResponse = recordInformantRegister(rejectedProsecutionAuthorityId, prosecutionAuthorityCode, registerDate,
hearingId, hearingDate, "json/informant-register/results.add-informant-register-document-request-with-invalid-verdict.json");
assertThat(writeResponse.getStatusCode(), equalTo(SC_ACCEPTED));

// Sentinel: a valid command submitted after the rejected one. Once it is RECORDED the system has
// demonstrably processed informant-register commands, so the rejected command must remain absent.
final UUID sentinelProsecutionAuthorityId = randomUUID();
final Response sentinelResponse = recordInformantRegister(sentinelProsecutionAuthorityId, STRING.next(), now(UTC),
randomUUID(), now(UTC).minusHours(1), "json/informant-register/results.add-informant-register-document-request.json");
assertThat(sentinelResponse.getStatusCode(), equalTo(SC_ACCEPTED));

helper.verifyInformantRegisterRejectedNotRecorded(sentinelProsecutionAuthorityId, rejectedProsecutionAuthorityId);
}

@Test
public void shouldAddInformantRegisterRequestForGroupCases() throws IOException {
final UUID prosecutionAuthorityId = randomUUID();
Expand Down
Loading