diff --git a/modules/apps/object/object-rest-test/src/testIntegration/java/com/liferay/object/rest/internal/resource/v1_0/test/ObjectEntryResourceTest.java b/modules/apps/object/object-rest-test/src/testIntegration/java/com/liferay/object/rest/internal/resource/v1_0/test/ObjectEntryResourceTest.java index f1953df9b5751f..b9eb64834a81f2 100644 --- a/modules/apps/object/object-rest-test/src/testIntegration/java/com/liferay/object/rest/internal/resource/v1_0/test/ObjectEntryResourceTest.java +++ b/modules/apps/object/object-rest-test/src/testIntegration/java/com/liferay/object/rest/internal/resource/v1_0/test/ObjectEntryResourceTest.java @@ -4945,12 +4945,20 @@ public void testPostCustomObjectEntryWithNestedCustomObjectEntriesInManyToManyRe Assert.assertEquals(2, nestedObjectEntriesJSONArray.length()); - _assertObjectEntryField( - (JSONObject)nestedObjectEntriesJSONArray.get(0), - _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_1); - _assertObjectEntryField( - (JSONObject)nestedObjectEntriesJSONArray.get(1), - _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_2); + JSONAssert.assertEquals( + JSONUtil.putAll( + JSONUtil.put( + _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_1 + ).put( + "externalReferenceCode", _ERC_VALUE_1 + ), + JSONUtil.put( + _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_2 + ).put( + "externalReferenceCode", _ERC_VALUE_2 + ) + ).toString(), + nestedObjectEntriesJSONArray.toString(), JSONCompareMode.LENIENT); objectEntryId = jsonObject.getString("id"); @@ -4967,12 +4975,20 @@ public void testPostCustomObjectEntryWithNestedCustomObjectEntriesInManyToManyRe Assert.assertEquals(2, nestedObjectEntriesJSONArray.length()); - _assertObjectEntryField( - (JSONObject)nestedObjectEntriesJSONArray.get(0), - _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_1); - _assertObjectEntryField( - (JSONObject)nestedObjectEntriesJSONArray.get(1), - _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_2); + JSONAssert.assertEquals( + JSONUtil.putAll( + JSONUtil.put( + _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_1 + ).put( + "externalReferenceCode", _ERC_VALUE_1 + ), + JSONUtil.put( + _OBJECT_FIELD_NAME_2, _NEW_OBJECT_FIELD_VALUE_2 + ).put( + "externalReferenceCode", _ERC_VALUE_2 + ) + ).toString(), + nestedObjectEntriesJSONArray.toString(), JSONCompareMode.LENIENT); } @Test