From 297c836d3224f45cc67733202c0d336257126db7 Mon Sep 17 00:00:00 2001 From: MarinhoFeliphe Date: Mon, 22 Jan 2024 11:07:47 -0300 Subject: [PATCH] LPS-206133 Rename and sort --- .../test/ObjectDefinitionResourceTest.java | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/modules/apps/object/object-admin-rest-test/src/testIntegration/java/com/liferay/object/admin/rest/resource/v1_0/test/ObjectDefinitionResourceTest.java b/modules/apps/object/object-admin-rest-test/src/testIntegration/java/com/liferay/object/admin/rest/resource/v1_0/test/ObjectDefinitionResourceTest.java index 3249324fefec72..4bbf4a46632fbc 100644 --- a/modules/apps/object/object-admin-rest-test/src/testIntegration/java/com/liferay/object/admin/rest/resource/v1_0/test/ObjectDefinitionResourceTest.java +++ b/modules/apps/object/object-admin-rest-test/src/testIntegration/java/com/liferay/object/admin/rest/resource/v1_0/test/ObjectDefinitionResourceTest.java @@ -405,6 +405,52 @@ public void testPutObjectDefinition() throws Exception { _objectDefinitionLocalService.deleteObjectDefinition( postObjectDefinition.getId()); + // Draft custom object definition + + postObjectDefinition = objectDefinitionResource.postObjectDefinition( + randomObjectDefinition()); + + Assert.assertEquals( + postObjectDefinition.getStatus(), + new Status() { + { + code = WorkflowConstants.STATUS_DRAFT; + label = WorkflowConstants.getStatusLabel( + WorkflowConstants.STATUS_DRAFT); + label_i18n = _language.get( + LanguageResources.getResourceBundle( + LocaleUtil.getDefault()), + WorkflowConstants.getStatusLabel( + WorkflowConstants.STATUS_DRAFT)); + } + }); + + postObjectDefinition.setStatus( + new Status() { + { + code = WorkflowConstants.STATUS_APPROVED; + } + }); + + ObjectDefinition randomPersistedPublishedObjectDefinition = + objectDefinitionResource.putObjectDefinition( + postObjectDefinition.getId(), postObjectDefinition); + + Assert.assertEquals( + randomPersistedPublishedObjectDefinition.getStatus(), + new Status() { + { + code = WorkflowConstants.STATUS_APPROVED; + label = WorkflowConstants.getStatusLabel( + WorkflowConstants.STATUS_APPROVED); + label_i18n = _language.get( + LanguageResources.getResourceBundle( + LocaleUtil.getDefault()), + WorkflowConstants.getStatusLabel( + WorkflowConstants.STATUS_APPROVED)); + } + }); + // Modifiable system object definition ObjectDefinition randomModifiableSystemObjectDefinition = @@ -521,52 +567,6 @@ public void testPutObjectDefinition() throws Exception { _objectDefinitionLocalService.deleteObjectDefinition( randomModifiableSystemObjectDefinition.getId()); - // Publish a persisted draft custom object definition - - postObjectDefinition = objectDefinitionResource.postObjectDefinition( - randomObjectDefinition()); - - Assert.assertEquals( - postObjectDefinition.getStatus(), - new Status() { - { - code = WorkflowConstants.STATUS_DRAFT; - label = WorkflowConstants.getStatusLabel( - WorkflowConstants.STATUS_DRAFT); - label_i18n = _language.get( - LanguageResources.getResourceBundle( - LocaleUtil.getDefault()), - WorkflowConstants.getStatusLabel( - WorkflowConstants.STATUS_DRAFT)); - } - }); - - postObjectDefinition.setStatus( - new Status() { - { - code = WorkflowConstants.STATUS_APPROVED; - } - }); - - ObjectDefinition randomPersistedPublishedObjectDefinition = - objectDefinitionResource.putObjectDefinition( - postObjectDefinition.getId(), postObjectDefinition); - - Assert.assertEquals( - randomPersistedPublishedObjectDefinition.getStatus(), - new Status() { - { - code = WorkflowConstants.STATUS_APPROVED; - label = WorkflowConstants.getStatusLabel( - WorkflowConstants.STATUS_APPROVED); - label_i18n = _language.get( - LanguageResources.getResourceBundle( - LocaleUtil.getDefault()), - WorkflowConstants.getStatusLabel( - WorkflowConstants.STATUS_APPROVED)); - } - }); - // Storage type postObjectDefinition = testPutObjectDefinition_addObjectDefinition();