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

Co-authored-by: rajatgarg <rajatgarg@adobe.com>
This commit is contained in:
Rajat Garg 2024-03-05 23:53:12 +05:30 committed by GitHub
parent 39e93518ce
commit e57e90754f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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");
} }