Skip to content

Commit 0fa54b7

Browse files
Fix programmatic validation test assertion
Use short name "A" instead of null to trigger @Length constraint, since RestAssured converts null to string in some profiles. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 15e3d1f commit 0fa54b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

integration-test/core/src/test/java/io/quarkiverse/resteasy/problem/ValidationMappersIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ void constraintViolationProgrammaticShouldNotStripMethodNamesFromPropertyPath()
144144
// This test ensures that programmatic validation violations preserve the original property path
145145
// without stripping method names (since there are no method names in programmatic validation)
146146
given()
147-
.queryParam("name", (Object) null) // Null name to trigger @NotNull
147+
.queryParam("name", "A") // Short name to trigger @Length constraint (but not @NotNull)
148148
.contentType(APPLICATION_JSON)
149149
.post("/throw/validation/constraint-violation-exception/programmatic")
150150
.then()
151151
.statusCode(BAD_REQUEST.getStatusCode())
152152
.body("violations", hasSize(3))
153153
// Verify that field names are simple property paths, not method.parameter.field
154-
.body("violations.find{it.field == 'name'}.message", equalTo("must not be null"))
154+
.body("violations.find{it.field == 'name'}.message", equalTo("length must be between 2 and 50"))
155155
.body("violations.find{it.field == 'email'}.message", equalTo("must be a well-formed email address"))
156156
.body("violations.find{it.field == 'age'}.message", equalTo("must be greater than or equal to 18"));
157157
}

0 commit comments

Comments
 (0)