Skip to content

Commit 5e73209

Browse files
Atharva JoshiAtharva Joshi
authored andcommitted
subschema test 1
Signed-off-by: Atharva Joshi <[email protected]>
1 parent 83c6e97 commit 5e73209

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

server/src/test/java/io/pravega/schemaregistry/rules/jsoncompatibility/JsonCompatibilityCheckerUtilsTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,16 @@ public void testArrayComparisionOnlyAddition() throws IOException {
122122
ArrayNode originalArray =(ArrayNode) originalNode;
123123
Assert.assertTrue(jsonCompatibilityCheckerUtils.arrayComparisionOnlyAddition(finalArray, originalArray));
124124
}
125+
126+
@Test
127+
public void testHasSubSchema() throws IOException {
128+
String x1 = "{\n" +
129+
"\"anyOf\": [\n" +
130+
"{ \"type\": \"string\" },\n" +
131+
"{ \"type\": \"number\" }\n" +
132+
"]\n" +
133+
"}\n";
134+
JsonNode node = objectMapper.readTree(ByteBuffer.wrap(x1.getBytes()).array());
135+
Assert.assertTrue(jsonCompatibilityCheckerUtils.hasSubSchema(node));
136+
}
125137
}

0 commit comments

Comments
 (0)