Skip to content

Commit a1051b2

Browse files
committed
test: update expected validation messages
1 parent 0417d28 commit a1051b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/ValidationALBE2ET.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void test_invalidInboundSQSEvent() throws IOException {
8585
// THEN
8686
// invocation should fail inbound validation and return an error message
8787
JsonNode validJsonNode = objectMapper.readTree(invocationResult.getResult());
88-
assertThat(validJsonNode.get("errorMessage").asText()).contains("$.price: is missing but it is required");
88+
assertThat(validJsonNode.get("errorMessage").asText()).contains(": required property 'price' not found");
8989
}
9090

9191
@Test
@@ -99,6 +99,6 @@ void test_invalidOutboundSQSEvent() throws IOException {
9999
// THEN
100100
// invocation should fail outbound validation and return 400
101101
JsonNode validJsonNode = objectMapper.readTree(invocationResult.getResult());
102-
assertThat(validJsonNode.get("errorMessage").asText()).contains("$.price: must have an exclusive maximum value of 1000");
102+
assertThat(validJsonNode.get("errorMessage").asText()).contains("/price: must have an exclusive maximum value of 1000");
103103
}
104104
}

powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/ValidationApiGWE2ET.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void test_invalidInboundApiGWEvent() throws IOException {
8686
// invocation should fail inbound validation and return 400
8787
JsonNode validJsonNode = objectMapper.readTree(invocationResult.getResult());
8888
assertThat(validJsonNode.get("statusCode").asInt()).isEqualTo(400);
89-
assertThat(validJsonNode.get("body").asText()).contains("$.price: is missing but it is required");
89+
assertThat(validJsonNode.get("body").asText()).contains(": required property 'price' not found");
9090
}
9191

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

0 commit comments

Comments
 (0)