SPRDT-987 cover remaining move-to-past-date reject scenarios#40
Merged
ozturkmenb merged 1 commit intoJul 14, 2026
Merged
Conversation
Ports the last two move-hearing-to-past-date reject scenarios that only existed as black-box tests in cpp-apitests, so listing-side coverage is complete and the apitests deterministic tier can eventually be deleted: - ListingCommandApiTest.shouldRejectMoveWhenRangeContainsNoSittingDay: a Saturday..Sunday span passes date validation but expands to zero sitting days -> 422 INVALID_DATE_RANGE with the no-sitting-day message. Unit level because the rule is pure date logic in workingDaysBetween(). - MoveHearingToPastDateIT.shouldRejectMoveWith400WhenStartTimeMissing: startTime omitted -> schema 400. IT level because the framework's JSON schema interceptor rejects before the handler runs, so a unit test cannot reach it. Mirrors the existing missing courtCentreId/courtRoomId tests via a new whenHearingIsMovedWithMissingStartTime() step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the two move-hearing-to-past-date reject scenarios that until now only existed as black-box tests in
cpp-apitests(MoveHearingToPastDateITonteam/pasthearingsthere), completing listing-side reject coverage for the command:INVALID_DATE_RANGEListingCommandApiTest.shouldRejectMoveWhenRangeContainsNoSittingDayworkingDaysBetween()startTime→ 400MoveHearingToPastDateIT.shouldRejectMoveWith400WhenStartTimeMissing(+whenHearingIsMovedWithMissingStartTime()step)Test-only change; no production code touched.
With this merged, every reject scenario of the move contract is covered in this repo, and the remaining deterministic reject tests in
cpp-apitests(see hmcts/cpp-apitests#468) can be deleted.Verification
mvn clean install— BUILD SUCCESS (ListingCommandApiTest42/42)./runIntegrationTests.sh— 235 tests, 0 failures, 0 errors, 3 skipped (exit 0);MoveHearingToPastDateIT13/13 in both full-suite runssonarcheck.sh— quality gate passedNote: an earlier full-suite run hit a pre-existing flake in
HearingCsvReportIT.initialize(court-calendar judiciary projection poll timing out at 30s while the view still served the pre-update judge). It failed twice (full suite + solo) and passed twice (baseline without this diff in 1.7s + final full suite) with identical production code — unrelated to this test-only change, but worth a look given it's the same court-calendar area as SPRDT-1164.