diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCEImpl.java index 8018b14e23..909a7a3ed1 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCEImpl.java @@ -255,7 +255,7 @@ public class ActionCollectionServiceCEImpl extends BaseService newActionService.generateActionByViewMode(action, false)) + .map(action -> newActionService.generateActionByViewMode(action, viewMode)) .collectList() .map(actionDTOList -> { actionCollectionViewDTO.setActions(actionDTOList); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java index 661c0bcea9..cf4b007d23 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceTest.java @@ -617,14 +617,25 @@ public class ActionCollectionServiceTest { actionCollectionDTO.setActions(List.of(action1)); actionCollectionDTO.setPluginType(PluginType.JS); - final ActionCollectionDTO createdActionCollectionDTO = layoutCollectionService + ActionCollectionDTO createdActionCollectionDTO = layoutCollectionService .createCollection(actionCollectionDTO, null) .block(); assert createdActionCollectionDTO != null; + assert createdActionCollectionDTO.getId() != null; + String createdActionCollectionId = createdActionCollectionDTO.getId(); - final Mono> viewModeCollectionsMono = applicationPageService - .publish(testApp.getId(), true) - .thenMany(actionCollectionService.getActionCollectionsForViewMode(testApp.getId(), null)) + applicationPageService.publish(testApp.getId(), true).block(); + + actionCollectionDTO.getActions().get(0).getActionConfiguration().setBody("updatedBody"); + + ActionCollectionDTO updatedActionCollectionDTO = layoutCollectionService + .updateUnpublishedActionCollection(createdActionCollectionId, actionCollectionDTO, null) + .block(); + assert updatedActionCollectionDTO != null; + assert updatedActionCollectionDTO.getId() != null; + + final Mono> viewModeCollectionsMono = actionCollectionService + .getActionCollectionsForViewMode(testApp.getId(), null) .collectList(); StepVerifier.create(viewModeCollectionsMono) @@ -645,7 +656,7 @@ public class ActionCollectionServiceTest { assertThat(variables.get(0).getValue()).isEqualTo("test"); // Metadata - assertThat(actionCollectionViewDTO.getId()).isEqualTo(createdActionCollectionDTO.getId()); + assertThat(actionCollectionViewDTO.getId()).isEqualTo(createdActionCollectionId); assertThat(actionCollectionViewDTO.getName()).isEqualTo("testCollection1"); assertThat(actionCollectionViewDTO.getApplicationId()).isEqualTo(testApp.getId()); assertThat(actionCollectionViewDTO.getPageId()).isEqualTo(testPage.getId());