Skip to content

Commit

Permalink
DT-1217: Change response code for surrender
Browse files Browse the repository at this point in the history
  • Loading branch information
nt-gt committed Jun 18, 2024
1 parent 84a7f6c commit 8ea94f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ private EblSurrenderScenarioListBuilder thenAllPathsFrom(
EblSurrenderState surrenderState) {
return switch (surrenderState) {
case AVAILABLE_FOR_SURRENDER -> thenEither(
requestSurrenderForDelivery(202).thenAllPathsFrom(DELIVERY_SURRENDER_REQUESTED),
requestSurrenderForAmendment(202).thenAllPathsFrom(AMENDMENT_SURRENDER_REQUESTED),
requestSurrenderForDelivery(204).thenAllPathsFrom(DELIVERY_SURRENDER_REQUESTED),
requestSurrenderForAmendment(204).thenAllPathsFrom(AMENDMENT_SURRENDER_REQUESTED),
acceptSurrenderRequest(409).thenAllHappyPathsFrom(AVAILABLE_FOR_SURRENDER),
rejectSurrenderRequest(409).thenAllHappyPathsFrom(AVAILABLE_FOR_SURRENDER)
);
Expand Down Expand Up @@ -76,7 +76,7 @@ private EblSurrenderScenarioListBuilder thenAllPathsFrom(
private EblSurrenderScenarioListBuilder thenAllHappyPathsFrom(
EblSurrenderState surrenderState) {
var cases = switch (surrenderState) {
case AVAILABLE_FOR_SURRENDER -> requestSurrenderForDelivery(202).thenAllHappyPathsFrom(DELIVERY_SURRENDER_REQUESTED);
case AVAILABLE_FOR_SURRENDER -> requestSurrenderForDelivery(204).thenAllHappyPathsFrom(DELIVERY_SURRENDER_REQUESTED);
case DELIVERY_SURRENDER_REQUESTED -> acceptSurrenderRequest(204);
case SURRENDERED_FOR_DELIVERY -> noAction();
case AMENDMENT_SURRENDER_REQUESTED -> acceptSurrenderRequest(204)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public ConformanceResponse handleRequest(ConformanceRequest request) {
.formatted(src, srr, tdr, eblStatesById.get(tdr)));

return request.createResponse(
202,
204,
Map.of("Api-Version", List.of(apiVersion)),
new ConformanceMessageBody(
objectMapper
Expand Down

0 comments on commit 8ea94f8

Please sign in to comment.