Skip to content

Commit

Permalink
refactor for varying dev message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ewan Donovan committed Jan 31, 2025
1 parent d76c369 commit 7ba3bfc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class HmppsBoldLrsExceptionHandlerTest : IntegrationTestBase() {
status = HttpStatus.REQUEST_TIMEOUT,
errorCode = "Request Timeout",
userMessage = "A request to an upstream service timed out.",
developerMessage = "Read timed out",
developerMessage = "dev message can vary",
moreInfo = "A request timed out while waiting for a response from an upstream service.",
)

Expand All @@ -134,7 +134,11 @@ class HmppsBoldLrsExceptionHandlerTest : IntegrationTestBase() {
.responseBody

val actualResponseString = actualResponse?.toString(Charsets.UTF_8)
assertThat(actualResponseString).isEqualTo(gson.toJson(expectedResponse))

val actualResponseObject = gson.fromJson(actualResponseString, HmppsBoldLrsExceptionHandler.ErrorResponse::class.java)

assertThat(actualResponseObject.copy(developerMessage = "dev message can vary"))
.isEqualTo(expectedResponse)
}

@Test
Expand Down

0 comments on commit 7ba3bfc

Please sign in to comment.