[BAEL-6393] Address review comments (#16052)

Co-authored-by: rajatgarg <[email protected]>
This commit is contained in:
Rajat Garg
2024-03-05 10:23:12 -08:00
committed by GitHub
co-authored by rajatgarg
parent 39e93518ce
commit e57e90754f
@@ -22,14 +22,14 @@ public class JsonNodeToArrayNodeConverterUnitTest {
int count = 0;
String json = "{\"objects\": [\"One\", \"Two\", \"Three\"]}";
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()) {
for (final JsonNode objNode : arrayNode) {
assertNotNull(objNode, "Array element should not be null");
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");
}