Skip to content

Commit ad5fd7d

Browse files
committed
test: Lock in 'unknown numeric format ignored' contract
1 parent 8420742 commit ad5fd7d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/test/java/com/retailsvc/http/validate/StringIntegerNumberTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,20 @@ void numberFormatFloat() {
296296
.extracting(t -> ((ValidationException) t).error().keyword())
297297
.isEqualTo("format");
298298
}
299+
300+
@Test
301+
void integerFormatUnknownIsIgnored() {
302+
IntegerSchema s =
303+
new IntegerSchema(
304+
Set.of(TypeName.INTEGER), null, null, null, null, null, "definitely-not-a-format");
305+
assertThatCode(() -> v.validate(42L, s, "/v")).doesNotThrowAnyException();
306+
}
307+
308+
@Test
309+
void numberFormatUnknownIsIgnored() {
310+
NumberSchema s =
311+
new NumberSchema(
312+
Set.of(TypeName.NUMBER), null, null, null, null, null, "definitely-not-a-format");
313+
assertThatCode(() -> v.validate(1.5, s, "/v")).doesNotThrowAnyException();
314+
}
299315
}

0 commit comments

Comments
 (0)