File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
main/java/org/everit/json/schema
test/java/org/everit/json/schema Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 22
22
*/
23
23
public class NullSchema extends Schema {
24
24
25
- public static final NullSchema INSTANCE = new NullSchema (builder ());
26
-
27
25
/**
28
26
* Builder class for {@link NullSchema}.
29
27
*/
@@ -35,6 +33,8 @@ public NullSchema build() {
35
33
}
36
34
}
37
35
36
+ public static final NullSchema INSTANCE = new NullSchema (builder ());
37
+
38
38
public static Builder builder () {
39
39
return new Builder ();
40
40
}
@@ -46,7 +46,8 @@ public NullSchema(final Builder builder) {
46
46
@ Override
47
47
public void validate (final Object subject ) {
48
48
if (!(subject == null || subject == JSONObject .NULL )) {
49
- throw new ValidationException ("expected: null, found: " + subject .getClass ().getSimpleName ());
49
+ throw new ValidationException (this , "expected: null, found: "
50
+ + subject .getClass ().getSimpleName ());
50
51
}
51
52
}
52
53
}
Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .everit .json .schema ;
17
17
18
- import org .everit .json .schema .NullSchema ;
19
- import org .everit .json .schema .ValidationException ;
20
18
import org .json .JSONObject ;
21
19
import org .junit .Test ;
22
20
23
21
public class NullSchemaTest {
24
22
25
- @ Test ( expected = ValidationException . class )
23
+ @ Test
26
24
public void failure () {
27
- NullSchema .INSTANCE . validate ( "null" );
25
+ TestSupport . exceptFailure ( NullSchema .INSTANCE , "null" );
28
26
}
29
27
30
28
@ Test
You can’t perform that action at this time.
0 commit comments