[BAEL-6393] Address review comments (#16052)
Co-authored-by: rajatgarg <rajatgarg@adobe.com>
This commit is contained in:
parent
39e93518ce
commit
e57e90754f
@ -22,14 +22,14 @@ public class JsonNodeToArrayNodeConverterUnitTest {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
String json = "{\"objects\": [\"One\", \"Two\", \"Three\"]}";
|
String json = "{\"objects\": [\"One\", \"Two\", \"Three\"]}";
|
||||||
final JsonNode arrayNode = new ObjectMapper().readTree(json).get("objects");
|
final JsonNode arrayNode = new ObjectMapper().readTree(json).get("objects");
|
||||||
|
assertNotNull(arrayNode, "The 'objects' array should not be null");
|
||||||
|
assertTrue(arrayNode.isArray(), "The 'objects' should be an array");
|
||||||
if (arrayNode.isArray()) {
|
if (arrayNode.isArray()) {
|
||||||
for (final JsonNode objNode : arrayNode) {
|
for (final JsonNode objNode : arrayNode) {
|
||||||
assertNotNull(objNode, "Array element should not be null");
|
assertNotNull(objNode, "Array element should not be null");
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertNotNull(arrayNode, "The 'objects' array should not be null");
|
|
||||||
assertTrue(arrayNode.isArray(), "The 'objects' should be an array");
|
|
||||||
assertEquals(3, count, "The 'objects' array should have 3 elements");
|
assertEquals(3, count, "The 'objects' array should have 3 elements");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user