Skip to content

Commit

Permalink
Fix corner case string format bug
Browse files Browse the repository at this point in the history
Signed-off-by: John Mazanec <[email protected]>
  • Loading branch information
jmazanec15 committed Apr 6, 2023
1 parent 6b20a9d commit 7ecb036
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ public void testSizeValidationFailsInvalidSize() throws IOException {
Request request = new Request("GET", restURI);

ResponseException ex = expectThrows(ResponseException.class, () -> client().performRequest(request));
String messageExpected = String.format(
"%s must be between %s and %s inclusive",
PARAM_SIZE,
SEARCH_MODEL_MIN_SIZE,
SEARCH_MODEL_MAX_SIZE
);
assertTrue(
ex.getMessage()
.contains(
String.format("%s must be between %d and %d inclusive", PARAM_SIZE, SEARCH_MODEL_MIN_SIZE, SEARCH_MODEL_MAX_SIZE)
)
String.format("FAILED - Expected \"%s\" to have \"%s\"", ex.getMessage(), messageExpected),
ex.getMessage().contains(messageExpected)
);
}

Expand Down

0 comments on commit 7ecb036

Please sign in to comment.