Skip to content

Commit

Permalink
610: Handle when a null status comes back from the RS history API
Browse files Browse the repository at this point in the history
  • Loading branch information
halprin committed Jan 15, 2024
1 parent 7cdd122 commit daec3ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ String[] getReceiverAndStatus(String responseBody) throws FormatterProcessingExc
}

PartnerMetadataStatus ourStatusFromReportStreamStatus(String rsStatus) {
if (rsStatus == null) {
return PartnerMetadataStatus.PENDING;
}

return switch (rsStatus) {
case "Error", "Not Delivering" -> PartnerMetadataStatus.FAILED;
case "Delivered" -> PartnerMetadataStatus.DELIVERED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,11 @@ class PartnerMetadataOrchestratorTest extends Specification {

then:
ourStatus == PartnerMetadataStatus.PENDING

when:
ourStatus = PartnerMetadataOrchestrator.getInstance().ourStatusFromReportStreamStatus(null)

then:
ourStatus == PartnerMetadataStatus.PENDING
}
}

0 comments on commit daec3ea

Please sign in to comment.