Skip to content

Commit e706bd4

Browse files
thcedclaude
andcommitted
fix: Address code review for /gates integration tests
Correct the misleading comment in postGateBodyWithBlockedReturns400 (it claimed to exercise a null case but the body sent a string value). Tighten the false-schema body assertion to pin the "keyword" field so an unrelated property containing the substring "false" cannot satisfy it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent cf49734 commit e706bd4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/com/retailsvc/http/OpenApiServerIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ void postGateBodyWithOnlyOpenReturns200() {
430430
void postGateBodyWithBlockedReturns400() {
431431
try (var server = newServer(Map.of("post-gate", new EchoHandler()));
432432
var client = httpClient()) {
433-
// Even null in 'blocked' triggers the false-schema rejection,
433+
// Any value in 'blocked' triggers the false-schema rejection,
434434
// because NeverSchema rejects every value.
435435
var body = "{\"open\":\"x\",\"blocked\":\"anything\"}";
436436
var request = newRequest(server, path, "POST", ofString(body));
@@ -440,7 +440,7 @@ void postGateBodyWithBlockedReturns400() {
440440
assertThat(response.statusCode()).isEqualTo(400);
441441
assertThat(response.headers().firstValue("Content-Type").orElse(""))
442442
.contains("application/problem+json");
443-
assertThat(response.body()).contains("false");
443+
assertThat(response.body()).contains("\"keyword\":\"false\"");
444444
} catch (IOException e) {
445445
fail(e);
446446
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)