Skip to content

Commit

Permalink
test: update expected validation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-tay committed Jul 2, 2024
1 parent 0417d28 commit a1051b2
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 @@ -85,7 +85,7 @@ void test_invalidInboundSQSEvent() throws IOException {
// THEN
// invocation should fail inbound validation and return an error message
JsonNode validJsonNode = objectMapper.readTree(invocationResult.getResult());
assertThat(validJsonNode.get("errorMessage").asText()).contains("$.price: is missing but it is required");
assertThat(validJsonNode.get("errorMessage").asText()).contains(": required property 'price' not found");
}

@Test
Expand All @@ -99,6 +99,6 @@ void test_invalidOutboundSQSEvent() throws IOException {
// THEN
// invocation should fail outbound validation and return 400
JsonNode validJsonNode = objectMapper.readTree(invocationResult.getResult());
assertThat(validJsonNode.get("errorMessage").asText()).contains("$.price: must have an exclusive maximum value of 1000");
assertThat(validJsonNode.get("errorMessage").asText()).contains("/price: must have an exclusive maximum value of 1000");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void test_invalidInboundApiGWEvent() throws IOException {
// invocation should fail inbound validation and return 400
JsonNode validJsonNode = objectMapper.readTree(invocationResult.getResult());
assertThat(validJsonNode.get("statusCode").asInt()).isEqualTo(400);
assertThat(validJsonNode.get("body").asText()).contains("$.price: is missing but it is required");
assertThat(validJsonNode.get("body").asText()).contains(": required property 'price' not found");
}

@Test
Expand All @@ -102,6 +102,6 @@ void test_invalidOutboundApiGWEvent() throws IOException {
JsonNode validJsonNode = objectMapper.readTree(invocationResult.getResult());
assertThat(validJsonNode.get("statusCode").asInt()).isEqualTo(400);
assertThat(validJsonNode.get("body").asText())
.contains("$.price: must have an exclusive maximum value of 1000");
.contains("/price: must have an exclusive maximum value of 1000");
}
}

0 comments on commit a1051b2

Please sign in to comment.