Skip to content

Commit

Permalink
LPS-206133 Rename and sort
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinhoFeliphe authored and brianchandotcom committed Jan 23, 2024
1 parent 7452ee8 commit 297c836
Showing 1 changed file with 46 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 297c836

Please sign in to comment.