diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java index 96f2e5bb158b..ec39de3168a2 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java @@ -388,8 +388,8 @@ public Mono getConsolidatedInfoForPageLoad( if (!isBlank(basePageId)) { /* Get current page */ fetches.add(branchedPageMonoCached - .flatMap(branchedPage -> applicationPageService.getPageAndMigrateDslByBranchAndBasePageId( - basePageId, branchedPage.getBranchName(), isViewMode, true)) + .flatMap(branchedPage -> applicationPageService.getPageAndMigrateDslByBranchedPageId( + branchedPage.getId(), isViewMode, true)) .as(this::toResponseDTO) .doOnError(e -> log.error("Error fetching current page", e)) .doOnSuccess(consolidatedAPIResponseDTO::setPageWithMigratedDsl) diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceImplTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceImplTest.java index 9ca8cad7151e..288cef9864cb 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceImplTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceImplTest.java @@ -263,7 +263,7 @@ public void testPageLoadResponseForViewMode() { samplePageDTO.setName("samplePageDTO"); doReturn(Mono.just(samplePageDTO)) .when(spyApplicationPageService) - .getPageAndMigrateDslByBranchAndBasePageId(anyString(), anyString(), anyBoolean(), anyBoolean()); + .getPageAndMigrateDslByBranchedPageId(anyString(), anyBoolean(), anyBoolean()); ActionViewDTO sampleActionViewDTO = new ActionViewDTO(); sampleActionViewDTO.setName("sampleActionViewDTO"); @@ -433,7 +433,7 @@ public void testPageLoadResponseForEditMode() { doReturn(Mono.just(new PageDTO())) .when(spyApplicationPageService) - .getPageAndMigrateDslByBranchAndBasePageId(anyString(), anyString(), anyBoolean(), anyBoolean()); + .getPageAndMigrateDslByBranchedPageId(anyString(), anyBoolean(), anyBoolean()); doReturn(Mono.just(sampleApplicationPagesDTO)) .when(spyNewPageService) @@ -455,7 +455,7 @@ public void testPageLoadResponseForEditMode() { doReturn(Mono.just(samplePageDTO)) .doReturn(Mono.just(samplePageDTO)) .when(spyApplicationPageService) - .getPageAndMigrateDslByBranchAndBasePageId(anyString(), anyString(), anyBoolean(), anyBoolean()); + .getPageAndMigrateDslByBranchedPageId(anyString(), anyBoolean(), anyBoolean()); doReturn(Mono.just(samplePageDTO)) .doReturn(Mono.just(samplePageDTO)) @@ -941,7 +941,7 @@ public void testPageLoadResponseForViewMode_whenBranchNameIsPresentInNonGitApp() samplePageDTO.setName("samplePageDTO"); doReturn(Mono.just(samplePageDTO)) .when(spyApplicationPageService) - .getPageAndMigrateDslByBranchAndBasePageId(anyString(), eq(null), anyBoolean(), anyBoolean()); + .getPageAndMigrateDslByBranchedPageId(anyString(), anyBoolean(), anyBoolean()); ActionViewDTO sampleActionViewDTO = new ActionViewDTO(); sampleActionViewDTO.setName("sampleActionViewDTO"); @@ -1148,11 +1148,7 @@ public void testPageLoadResponseForEditModeWhenDefaultBranchIsDifferentFromDefau doReturn(Mono.just(new PageDTO())) .when(spyApplicationPageService) - .getPageAndMigrateDslByBranchAndBasePageId(anyString(), anyString(), anyBoolean(), anyBoolean()); - - // doReturn(Mono.just(sampleApplicationPagesDTO)) - // .when(spyNewPageService) - // .createApplicationPagesDTO(any(), any(), anyBoolean(), anyBoolean()); + .getPageAndMigrateDslByBranchedPageId(anyString(), anyBoolean(), anyBoolean()); Theme sampleTheme = new Theme(); sampleTheme.setName("sampleTheme"); @@ -1170,7 +1166,7 @@ public void testPageLoadResponseForEditModeWhenDefaultBranchIsDifferentFromDefau doReturn(Mono.just(samplePageDTO)) .doReturn(Mono.just(samplePageDTO)) .when(spyApplicationPageService) - .getPageAndMigrateDslByBranchAndBasePageId(anyString(), anyString(), anyBoolean(), anyBoolean()); + .getPageAndMigrateDslByBranchedPageId(anyString(), anyBoolean(), anyBoolean()); doReturn(Mono.just(samplePageDTO)) .doReturn(Mono.just(samplePageDTO))