1
- package com .relogiclabs .json . schema ;
1
+ package com .relogiclabs .jschema ;
2
2
3
- import com .relogiclabs .json . schema . internal .util .DebugUtilities ;
4
- import com .relogiclabs .json . schema .tree .DataTree ;
5
- import com .relogiclabs .json . schema .tree .JsonTree ;
6
- import com .relogiclabs .json . schema .tree .RuntimeContext ;
7
- import com .relogiclabs .json . schema .tree .SchemaTree ;
8
- import com .relogiclabs .json . schema .tree .TreeType ;
3
+ import com .relogiclabs .jschema . internal .util .LogHelper ;
4
+ import com .relogiclabs .jschema .tree .DataTree ;
5
+ import com .relogiclabs .jschema .tree .JsonTree ;
6
+ import com .relogiclabs .jschema .tree .RuntimeContext ;
7
+ import com .relogiclabs .jschema .tree .SchemaTree ;
8
+ import com .relogiclabs .jschema .tree .TreeType ;
9
9
import lombok .Getter ;
10
10
11
- import static com .relogiclabs .json . schema .message .MessageFormatter .JSON_ASSERTION ;
12
- import static com .relogiclabs .json . schema .message .MessageFormatter .SCHEMA_ASSERTION ;
13
- import static com .relogiclabs .json . schema .tree .TreeType .JSON_TREE ;
14
- import static com .relogiclabs .json . schema .tree .TreeType .SCHEMA_TREE ;
11
+ import static com .relogiclabs .jschema .message .MessageFormatter .JSON_ASSERTION ;
12
+ import static com .relogiclabs .jschema .message .MessageFormatter .SCHEMA_ASSERTION ;
13
+ import static com .relogiclabs .jschema .tree .TreeType .JSON_TREE ;
14
+ import static com .relogiclabs .jschema .tree .TreeType .SCHEMA_TREE ;
15
15
16
16
/**
17
17
* The class provides assertion functionalities to validate JSON documents against
18
- * a Schema or JSON.
18
+ * a JSchema or JSON document .
19
19
*/
20
20
@ Getter
21
21
public class JsonAssert {
@@ -24,19 +24,19 @@ public class JsonAssert {
24
24
25
25
/**
26
26
* Initializes a new instance of the {@link JsonAssert} class for the
27
- * specified Schema string.
28
- * @param schema A Schema string for validation or conformation
27
+ * specified JSchema string.
28
+ * @param schema A JSchema string for validation or conformation
29
29
*/
30
30
public JsonAssert (String schema ) {
31
31
this (schema , SCHEMA_TREE );
32
32
}
33
33
34
34
/**
35
35
* Initializes a new instance of the {@link JsonAssert} class for the specified
36
- * {@code expected} string, which can be either a Schema or a JSON representation.
37
- * @param expected An expected Schema or JSON string for validation or conformation
36
+ * {@code expected} string, which can be either a JSchema or a JSON representation.
37
+ * @param expected An expected JSchema or JSON string for validation or conformation
38
38
* @param type The type of string provided by {@code expected}, indicating whether it represents
39
- * a Schema or JSON. Use {@link TreeType#SCHEMA_TREE} for Schema and {@link TreeType#JSON_TREE}
39
+ * a JSchema or JSON. Use {@link TreeType#SCHEMA_TREE} for JSchema and {@link TreeType#JSON_TREE}
40
40
* for JSON.
41
41
*/
42
42
public JsonAssert (String expected , TreeType type ) {
@@ -50,22 +50,22 @@ public JsonAssert(String expected, TreeType type) {
50
50
}
51
51
52
52
/**
53
- * Tests whether the input JSON string conforms to the expected Schema or JSON
53
+ * Tests whether the input JSON string conforms to the expected JSchema or JSON
54
54
* specified in the {@link JsonAssert} constructor.
55
55
* @param json The actual input JSON to conform or validate
56
56
*/
57
57
public void isValid (String json ) {
58
58
runtime .clear ();
59
59
var jsonTree = new JsonTree (runtime , json );
60
- DebugUtilities . print (expectedTree , jsonTree );
60
+ LogHelper . debug (expectedTree , jsonTree );
61
61
if (!expectedTree .match (jsonTree ))
62
62
throw new IllegalStateException ("Invalid runtime state" );
63
63
}
64
64
65
65
/**
66
- * Tests whether the specified JSON string conforms to the given Schema string
67
- * and throws an exception if the JSON string does not conform to the Schema .
68
- * @param schema The expected Schema to conform or validate
66
+ * Tests whether the specified JSON string conforms to the given JSchema string
67
+ * and throws an exception if the JSON string does not conform to the JSchema .
68
+ * @param schema The expected JSchema to conform or validate
69
69
* @param json The actual JSON to conform or validate
70
70
*/
71
71
public static void isValid (String schema , String json ) {
0 commit comments