Skip to content

Commit

Permalink
changed method to fetch applicationPage, now using branchedId directly
Browse files Browse the repository at this point in the history
  • Loading branch information
sondermanish committed Nov 8, 2024
1 parent 2de6e5e commit f6124cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ public Mono<ConsolidatedAPIResponseDTO> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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)
Expand All @@ -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))
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand All @@ -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))
Expand Down

0 comments on commit f6124cb

Please sign in to comment.