18
18
19
19
import com .fasterxml .jackson .databind .JsonNode ;
20
20
import com .fasterxml .jackson .databind .ObjectMapper ;
21
+ import org .junit .jupiter .api .Disabled ;
21
22
import org .junit .jupiter .api .Test ;
22
23
23
24
import java .io .IOException ;
@@ -40,13 +41,51 @@ public void testLoadingWithId() throws Exception {
40
41
JsonSchema schema = factory .getSchema (schemaJson );
41
42
}
42
43
44
+ @ Test
45
+ @ Disabled
46
+ public void testFormatDateTimeValidator () throws Exception {
47
+ runTestFile ("draft4/optional/format/date-time.json" );
48
+ }
49
+
50
+ @ Test
51
+ public void testFormatEmailValidator () throws Exception {
52
+ runTestFile ("draft4/optional/format/email.json" );
53
+ }
54
+
55
+ @ Test
56
+ public void testFormatHostnameValidator () throws Exception {
57
+ runTestFile ("draft4/optional/format/hostname.json" );
58
+ }
59
+
60
+ @ Test
61
+ @ Disabled
62
+ public void testFormatIpv4Validator () throws Exception {
63
+ runTestFile ("draft4/optional/format/ipv4.json" );
64
+ }
65
+
66
+ @ Test
67
+ @ Disabled
68
+ public void testFormatIpv6Validator () throws Exception {
69
+ runTestFile ("draft4/optional/format/ipv6.json" );
70
+ }
71
+
72
+ @ Test
73
+ public void testFormatUnknownValidator () throws Exception {
74
+ runTestFile ("draft4/optional/format/unknown.json" );
75
+ }
76
+
77
+ @ Test
78
+ public void testFormatUriValidator () throws Exception {
79
+ runTestFile ("draft4/optional/format/uri.json" );
80
+ }
81
+
43
82
@ Test
44
83
public void testBignumValidator () throws Exception {
45
84
runTestFile ("draft4/optional/bignum.json" );
46
85
}
47
86
48
87
@ Test
49
- public void testFormatValidator () throws Exception {
88
+ public void testOptionalFormatValidator () throws Exception {
50
89
runTestFile ("draft4/optional/format.json" );
51
90
}
52
91
@@ -55,6 +94,16 @@ public void testComplexSchema() throws Exception {
55
94
runTestFile ("draft4/optional/complex.json" );
56
95
}
57
96
97
+ @ Test
98
+ public void testFloatOverflowValidator () throws Exception {
99
+ runTestFile ("draft4/optional/float-overflow.json" );
100
+ }
101
+
102
+ @ Test
103
+ public void testNonBmpRegexValidator () throws Exception {
104
+ runTestFile ("draft4/optional/non-bmp-regex.json" );
105
+ }
106
+
58
107
@ Test
59
108
public void testZeroTerminatedFloatsValidator () throws Exception {
60
109
runTestFile ("draft4/optional/zeroTerminatedFloats.json" );
@@ -100,6 +149,22 @@ public void testEnumValidator() throws Exception {
100
149
runTestFile ("draft4/enum.json" );
101
150
}
102
151
152
+ @ Test
153
+ public void testFormatValidator () throws Exception {
154
+ runTestFile ("draft4/format.json" );
155
+ }
156
+
157
+ @ Test
158
+ @ Disabled
159
+ public void testIdValidator () throws Exception {
160
+ runTestFile ("draft4/id.json" );
161
+ }
162
+
163
+ @ Test
164
+ public void testInfiniteLoopDetectionValidator () throws Exception {
165
+ runTestFile ("draft4/infinite-loop-detection.json" );
166
+ }
167
+
103
168
@ Test
104
169
public void testItemsValidator () throws Exception {
105
170
runTestFile ("draft4/items.json" );
@@ -207,7 +272,7 @@ public void testTypeValidator() throws Exception {
207
272
208
273
@ Test
209
274
public void testUnionTypeValidator () throws Exception {
210
- runTestFile ("draft4/union_type.json" );
275
+ runTestFile ("draft4/extra/ union_type.json" );
211
276
}
212
277
213
278
@ Test
@@ -222,17 +287,17 @@ public void testEnumObject() throws Exception {
222
287
223
288
@ Test
224
289
public void testIdSchemaWithUrl () throws Exception {
225
- runTestFile ("draft4/property.json" );
290
+ runTestFile ("draft4/extra/ property.json" );
226
291
}
227
292
228
293
@ Test
229
294
public void testSchemaFromClasspath () throws Exception {
230
- runTestFile ("draft4/classpath/schema.json" );
295
+ runTestFile ("draft4/extra/ classpath/schema.json" );
231
296
}
232
297
233
298
@ Test
234
299
public void testUUIDValidator () throws Exception {
235
- runTestFile ("draft4/uuid.json" );
300
+ runTestFile ("draft4/extra/ uuid.json" );
236
301
}
237
302
238
303
/**
@@ -241,7 +306,7 @@ public void testUUIDValidator() throws Exception {
241
306
@ Test
242
307
public void testFailFast_AllErrors () throws IOException {
243
308
try {
244
- validateFailingFastSchemaFor ("product.schema.json" , "product-all-errors-data.json" );
309
+ validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-all-errors-data.json" );
245
310
fail ("Exception must be thrown" );
246
311
} catch (JsonSchemaException e ) {
247
312
final Set <ValidationMessage > messages = e .getValidationMessages ();
@@ -255,7 +320,7 @@ public void testFailFast_AllErrors() throws IOException {
255
320
@ Test
256
321
public void testFailFast_OneErrors () throws IOException {
257
322
try {
258
- validateFailingFastSchemaFor ("product.schema.json" , "product-one-error-data.json" );
323
+ validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-one-error-data.json" );
259
324
fail ("Exception must be thrown" );
260
325
} catch (JsonSchemaException e ) {
261
326
final Set <ValidationMessage > messages = e .getValidationMessages ();
@@ -269,7 +334,7 @@ public void testFailFast_OneErrors() throws IOException {
269
334
@ Test
270
335
public void testFailFast_TwoErrors () throws IOException {
271
336
try {
272
- validateFailingFastSchemaFor ("product.schema.json" , "product-two-errors-data.json" );
337
+ validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-two-errors-data.json" );
273
338
fail ("Exception must be thrown" );
274
339
} catch (JsonSchemaException e ) {
275
340
final Set <ValidationMessage > messages = e .getValidationMessages ();
@@ -283,7 +348,7 @@ public void testFailFast_TwoErrors() throws IOException {
283
348
@ Test
284
349
public void testFailFast_NoErrors () throws IOException {
285
350
try {
286
- final Set <ValidationMessage > messages = validateFailingFastSchemaFor ("product.schema.json" , "product-no-errors-data.json" );
351
+ final Set <ValidationMessage > messages = validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-no-errors-data.json" );
287
352
assertTrue (messages .isEmpty ());
288
353
} catch (JsonSchemaException e ) {
289
354
fail ("Must not get an errors" );
0 commit comments