diff --git a/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundary.java b/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundary.java index 8d3308c99..c2ee029b3 100644 --- a/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundary.java +++ b/AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundary.java @@ -79,7 +79,6 @@ import java.util.stream.Collectors; import static ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentFilterTypes.QLConstants.DEPLOYMENT_QL_ALIAS; -import static ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentFilterTypes.QLConstants.GROUP_QL; @Stateless @@ -179,12 +178,9 @@ public ComparatorFilterOption[] getComparatorFilterOptions() { * @param filters * @param colToSort * @param sortingDirection - * @param myAmw * @return a Tuple containing the filter deployments and the total deployments for that filter if doPagingCalculation is true */ - public Tuple, Integer> getFilteredDeployments(Integer startIndex, - Integer maxResults, List filters, String colToSort, - Sort.SortingDirectionType sortingDirection, List myAmw) { + public Tuple, Integer> getFilteredDeployments(Integer startIndex, Integer maxResults, List filters, String colToSort, Sort.SortingDirectionType sortingDirection) { Integer totalItemsForCurrentFilter; boolean doPaging = maxResults != null && (maxResults > 0); @@ -216,10 +212,8 @@ public Tuple, Integer> getFilteredDeployments(Integer star } else { stringQuery.append("select " + DEPLOYMENT_QL_ALIAS + " from " + DEPLOYMENT_ENTITY_NAME + " " + DEPLOYMENT_QL_ALIAS + " "); } - commonFilterService.appendWhereAndMyAmwParameter(myAmw, stringQuery, "and " + getEntityDependantMyAmwParameterQl()); } else { stringQuery.append("select " + DEPLOYMENT_QL_ALIAS + " from " + DEPLOYMENT_ENTITY_NAME + " " + DEPLOYMENT_QL_ALIAS + " "); - commonFilterService.appendWhereAndMyAmwParameter(myAmw, stringQuery, getEntityDependantMyAmwParameterQl()); } String baseQuery = stringQuery.toString(); @@ -239,7 +233,7 @@ public Tuple, Integer> getFilteredDeployments(Integer star sortBuilder.order(DeploymentOrder.of(DeploymentFilterTypes.ID.getFilterTabColumnName(), Sort.SortingDirectionType.DESC, false)); Query query = commonFilterService.addFilterAndCreateQuery(stringQuery, filters, sortBuilder.build(), hasLastDeploymentForAsEnvFilterSet, false); - query = commonFilterService.setParameterToQuery(startIndex, maxResults, myAmw, query); + query = commonFilterService.setParameterToQuery(startIndex, maxResults, query); Set deployments = new LinkedHashSet<>(); // some stuff may be lazy loaded @@ -265,7 +259,7 @@ public Tuple, Integer> getFilteredDeployments(Integer star // last param needs to be true if we are dealing with a combination of "State" and "Latest deployment job for App Server and Env" Query countQuery = commonFilterService.addFilterAndCreateQuery(new StringBuilder(countQueryString), filters, Sort.nothing(), hasLastDeploymentForAsEnvFilterSet, lastDeploymentState != null); - commonFilterService.setParameterToQuery(null, null, myAmw, countQuery); + commonFilterService.setParameterToQuery(null, null, countQuery); totalItemsForCurrentFilter = (lastDeploymentState == null) ? ((Long) countQuery.getSingleResult()).intValue() : countQuery.getResultList().size(); // fix for the special case of multiple deployments on the same environment with exactly the same deployment date if (hasLastDeploymentForAsEnvFilterSet && lastDeploymentState == null && deployments.size() != allResults) { @@ -437,10 +431,6 @@ public int compare(DeploymentEntity o1, DeploymentEntity o2) { return deploymentsList; } - private String getEntityDependantMyAmwParameterQl() { - return "(" + GROUP_QL + ".id in (:" + CommonFilterService.MY_AMW + ")) "; - } - private boolean isLastDeploymentForAsEnvFilterSet(List filter) { if (filter != null) { for (CustomFilter deploymentFilter : filter) { diff --git a/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryPersistenceTest.java b/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryPersistenceTest.java index 2f414d726..36e2bdc48 100644 --- a/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryPersistenceTest.java +++ b/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryPersistenceTest.java @@ -789,7 +789,7 @@ public void test_getFilteredDeployments_sortByRelease() { // when sorting by release ascending (releaseA - releaseC - releaseB) String colToSort = DeploymentFilterTypes.RELEASE.getFilterTabColumnName(); Tuple, Integer> result1 = deploymentBoundary.getFilteredDeployments(0, 10, - Collections.EMPTY_LIST, colToSort, Sort.SortingDirectionType.ASC, null); + Collections.EMPTY_LIST, colToSort, Sort.SortingDirectionType.ASC); // then assertNotNull(result1); @@ -801,7 +801,7 @@ public void test_getFilteredDeployments_sortByRelease() { // when sorting by release descending (releaseB - releaseC - releaseC) Tuple, Integer> result2 = deploymentBoundary.getFilteredDeployments(0, 10, - Collections.EMPTY_LIST, colToSort, Sort.SortingDirectionType.DESC, null); + Collections.EMPTY_LIST, colToSort, Sort.SortingDirectionType.DESC); // then assertNotNull(result2); @@ -857,7 +857,7 @@ public void test_getFilteredDeployments_filterByRelease() { .comparatorSelection(ComparatorFilterOption.gte).build(); filter.setValue(CustomFilter.convertDateToString(releaseA.getInstallationInProductionAt())); result = deploymentBoundary.getFilteredDeployments(0, 10, Collections.singletonList(filter), null, - Sort.SortingDirectionType.ASC, null); + Sort.SortingDirectionType.ASC); // then assertNotNull(result); @@ -870,7 +870,7 @@ public void test_getFilteredDeployments_filterByRelease() { filter.setValue(CustomFilter.convertDateToString(releaseC.getInstallationInProductionAt())); filter.setComparatorSelection(ComparatorFilterOption.lte); result = deploymentBoundary.getFilteredDeployments(0, 10, Collections.singletonList(filter), null, - Sort.SortingDirectionType.ASC, null); + Sort.SortingDirectionType.ASC); // then assertNotNull(result); @@ -883,7 +883,7 @@ public void test_getFilteredDeployments_filterByRelease() { filter.setValue(CustomFilter.convertDateToString(releaseB.getInstallationInProductionAt())); filter.setComparatorSelection(ComparatorFilterOption.eq); result = deploymentBoundary.getFilteredDeployments(0, 10, Collections.singletonList(filter), null, - Sort.SortingDirectionType.ASC, null); + Sort.SortingDirectionType.ASC); // then assertNotNull(result); @@ -1123,7 +1123,7 @@ public void shouldReturnTheRightFilteredDeploymentsInTheRightOrderIfLatestDeploy // when sorting by release ascending String colToSort = DeploymentFilterTypes.RELEASE.getFilterTabColumnName(); - Tuple, Integer> result1 = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC, null); + Tuple, Integer> result1 = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC); // then assertNotNull(result1); @@ -1134,7 +1134,7 @@ public void shouldReturnTheRightFilteredDeploymentsInTheRightOrderIfLatestDeploy assertThat(it.next().getRelease(), is(release2)); // when sorting by release descending - Tuple, Integer> result2 = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.DESC, null); + Tuple, Integer> result2 = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.DESC); // then assertNotNull(result2); @@ -1210,7 +1210,7 @@ public void shouldReturnTheRightFilteredDeploymentsIfLatestDeploymentJobFilterAn String colToSort = DeploymentFilterTypes.RELEASE.getFilterTabColumnName(); // when - Tuple, Integer> result = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC, null); + Tuple, Integer> result = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC); // then assertNotNull(result); @@ -1286,7 +1286,7 @@ public void shouldReturnDeploymentWithHighestIdPerEnvironmentIfLatestDeploymentJ String colToSort = DeploymentFilterTypes.RELEASE.getFilterTabColumnName(); // when - Tuple, Integer> result = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC, null); + Tuple, Integer> result = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC); // then assertNotNull(result); @@ -1361,7 +1361,7 @@ public void shouldReturnDeploymentWithHighestIdPerEnvironmentIfLatestDeploymentJ // when sorted by tracking id asc String colToSort = DeploymentFilterTypes.TRACKING_ID.getFilterTabColumnName(); - Tuple, Integer> result1 = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC, null); + Tuple, Integer> result1 = deploymentBoundary.getFilteredDeployments(0, 10, filters, colToSort, Sort.SortingDirectionType.ASC); // then assertNotNull(result1); @@ -1379,7 +1379,7 @@ public void shouldReturnDeploymentWithHighestIdPerEnvironmentIfLatestDeploymentJ // when sorted by tracking id desc colToSort = DeploymentFilterTypes.TRACKING_ID.getFilterTabColumnName(); - Tuple, Integer> result2 = deploymentBoundary.getFilteredDeployments( 0, 10, filters, colToSort, Sort.SortingDirectionType.DESC, null); + Tuple, Integer> result2 = deploymentBoundary.getFilteredDeployments( 0, 10, filters, colToSort, Sort.SortingDirectionType.DESC); // then assertNotNull(result2); diff --git a/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryTest.java b/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryTest.java index 66f3643fa..492cf8e73 100644 --- a/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryTest.java +++ b/AMW_business/src/test/java/ch/puzzle/itc/mobiliar/business/deploy/boundary/DeploymentBoundaryTest.java @@ -267,10 +267,10 @@ public void shouldSetSortColumnIfColumnKnown() { // given Query query = mock(Query.class); when(commonFilterService.addFilterAndCreateQuery(any(), any(), any(), anyBoolean(), anyBoolean())).thenReturn(query); - when(commonFilterService.setParameterToQuery(any(), any(), any(), any())).thenReturn(query); + when(commonFilterService.setParameterToQuery(any(), any(), any())).thenReturn(query); // when - deploymentBoundary.getFilteredDeployments(0, null, emptyList(), "d.trackingId", DESC, emptyList() ); + deploymentBoundary.getFilteredDeployments(0, null, emptyList(), "d.trackingId", DESC); // then ArgumentCaptor sortCaptor = ArgumentCaptor.forClass(Sort.class); @@ -283,10 +283,10 @@ public void shouldIgnoreSortColumnIfNull() { // given Query query = mock(Query.class); when(commonFilterService.addFilterAndCreateQuery(any(), any(), any(), anyBoolean(), anyBoolean())).thenReturn(query); - when(commonFilterService.setParameterToQuery(any(), any(), any(), any())).thenReturn(query); + when(commonFilterService.setParameterToQuery(any(), any(), any())).thenReturn(query); // when - deploymentBoundary.getFilteredDeployments(0, null, emptyList(), null, DESC, emptyList() ); + deploymentBoundary.getFilteredDeployments(0, null, emptyList(), null, DESC); // then ArgumentCaptor sortCaptor = ArgumentCaptor.forClass(Sort.class); @@ -301,7 +301,7 @@ public void shouldIgnoreSortColumnIfNull() { public void shouldThrowIfSortColumnUnknown() { try { // when - deploymentBoundary.getFilteredDeployments(0, null, emptyList(), "unknown.column", DESC, emptyList()); + deploymentBoundary.getFilteredDeployments(0, null, emptyList(), "unknown.column", DESC); fail("IllegalArgumentException should have been thrown"); } catch (IllegalArgumentException ex) { // then diff --git a/AMW_rest/src/main/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentsRest.java b/AMW_rest/src/main/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentsRest.java index e990c622b..1bd8303d3 100644 --- a/AMW_rest/src/main/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentsRest.java +++ b/AMW_rest/src/main/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentsRest.java @@ -68,7 +68,6 @@ import java.net.URI; import java.util.*; import java.util.logging.Logger; -import java.util.stream.Collectors; import static ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentFilterTypes.*; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; @@ -129,7 +128,7 @@ public Response getDeployments(@ApiParam("Filters") @QueryParam("filters") Strin } Sort.SortingDirectionType sortingDirectionType = getSortingDirectionType(sortDirection); LinkedList filters = createCustomFilters(filterDTOs); - Tuple, Integer> filteredDeployments = deploymentBoundary.getFilteredDeployments(offset, maxResults, filters, colToSort, sortingDirectionType, null); + Tuple, Integer> filteredDeployments = deploymentBoundary.getFilteredDeployments(offset, maxResults, filters, colToSort, sortingDirectionType); List deploymentDTOs = createDeploymentDTOs(filteredDeployments); return Response.status(Status.OK).header("X-Total-Count", filteredDeployments.getB()).entity(new GenericEntity>(deploymentDTOs) {}).build(); } @@ -288,7 +287,7 @@ public Response getDeployments( if (deploymentParameterValues != null) { createFiltersAndAddToList(DEPLOYMENT_PARAMETER, deploymentParameterValues, filters); } - Tuple, Integer> filteredDeployments = deploymentBoundary.getFilteredDeployments(offset, maxResults, filters, null, null, null); + Tuple, Integer> filteredDeployments = deploymentBoundary.getFilteredDeployments(offset, maxResults, filters, null, null); List deploymentDTOs = createDeploymentDTOs(filteredDeployments); @@ -507,7 +506,7 @@ public Response addDeployment(@ApiParam("Deployment Request") DeploymentRequestD CustomFilter trackingIdFilter = CustomFilter.builder(TRACKING_ID).build(); trackingIdFilter.setValue(trackingId.toString()); filters.add(trackingIdFilter); - Tuple, Integer> result = deploymentBoundary.getFilteredDeployments( 0, 1, filters, null, null, null); + Tuple, Integer> result = deploymentBoundary.getFilteredDeployments( 0, 1, filters, null, null); DeploymentDTO deploymentDto = new DeploymentDTO(result.getA().iterator().next()); diff --git a/AMW_rest/src/test/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentTest.java b/AMW_rest/src/test/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentTest.java index 5274fa518..e593c3864 100644 --- a/AMW_rest/src/test/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentTest.java +++ b/AMW_rest/src/test/java/ch/mobi/itc/mobiliar/rest/deployments/DeploymentTest.java @@ -200,7 +200,7 @@ public void configure() { @SuppressWarnings("unchecked") @Test public void getDeploymentsBasic() { - when(deploymentBoundary.getFilteredDeployments(null, null, new LinkedList(), null, null, null)).thenReturn( + when(deploymentBoundary.getFilteredDeployments(null, null, new LinkedList(), null, null)).thenReturn( new Tuple, Integer>(new HashSet(), 0)); Response response = deploymentRestService.getDeployments(null, null, null, null, null, null, null, null, null, null, null, null, false); @@ -215,37 +215,37 @@ public void getDeploymentsBasic() { @Test public void verifyThatDeploymentServiceIsCalledWithNonEmptyFilterIfDeploymentParametersAreSet() { - when(deploymentBoundary.getFilteredDeployments(isNull(), isNull(), anyList(), isNull(), isNull(), isNull())).thenReturn( + when(deploymentBoundary.getFilteredDeployments(isNull(), isNull(), anyList(), isNull(), isNull())).thenReturn( new Tuple, Integer>(new HashSet(), 0)); deploymentRestService.getDeployments(null, null, null, null, null, null, null, null, null, null, Collections.singletonList("TEST"), null, false); @SuppressWarnings("unchecked") ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); - verify(deploymentBoundary, times(1)).getFilteredDeployments(isNull(), isNull(), captor.capture(), isNull(), isNull(), isNull()); + verify(deploymentBoundary, times(1)).getFilteredDeployments(isNull(), isNull(), captor.capture(), isNull(), isNull()); assertEquals(1, captor.getValue().size()); } @Test public void verifyThatDeploymentServiceIsCalledWithNonEmptyFilterIfDeploymentParameterValuesAreSet() { - when(deploymentBoundary.getFilteredDeployments(isNull(), isNull(), anyList(), isNull(), isNull(), isNull())).thenReturn( + when(deploymentBoundary.getFilteredDeployments(isNull(), isNull(), anyList(), isNull(), isNull())).thenReturn( new Tuple, Integer>(new HashSet(), 0)); deploymentRestService.getDeployments(null, null, null, null, null, null, null, null, null, null, null, Collections.singletonList("TESTVALUE"), false); @SuppressWarnings("unchecked") ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); - verify(deploymentBoundary, times(1)).getFilteredDeployments(isNull(), isNull(), captor.capture(), isNull(), isNull(), isNull()); + verify(deploymentBoundary, times(1)).getFilteredDeployments(isNull(), isNull(), captor.capture(), isNull(), isNull()); assertEquals(1, captor.getValue().size()); } @Test public void verifyThatDeploymentServiceIsCalledWithNonEmptyFilterIfDeploymentParametersAndDeploymentParameterValuesAreSet() { - when(deploymentBoundary.getFilteredDeployments(isNull(), isNull(), anyList(), isNull(), isNull(), isNull())).thenReturn( + when(deploymentBoundary.getFilteredDeployments(isNull(), isNull(), anyList(), isNull(), isNull())).thenReturn( new Tuple, Integer>(new HashSet(), 0)); deploymentRestService.getDeployments(null, null, null, null, null, null, null, null, null, null, Collections.singletonList("TEST"), Collections.singletonList("TESTVALUE"), false); @SuppressWarnings("unchecked") ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); - verify(deploymentBoundary, times(1)).getFilteredDeployments(isNull(), isNull(), captor.capture(), isNull(), isNull(), isNull()); + verify(deploymentBoundary, times(1)).getFilteredDeployments(isNull(), isNull(), captor.capture(), isNull(), isNull()); assertEquals(2, captor.getValue().size()); } @@ -287,7 +287,7 @@ public void addDeployment() { when(environmentsService.getContextByName(deploymentEntity.getContext().getName())) .thenReturn(deploymentEntity.getContext()); - when(deploymentBoundary.getFilteredDeployments(eq(0), eq(1), any(LinkedList.class), isNull(), isNull(), isNull())).thenReturn( + when(deploymentBoundary.getFilteredDeployments(eq(0), eq(1), any(LinkedList.class), isNull(), isNull())).thenReturn( new Tuple, Integer>(entities, entities.size())); when(releaseService.findByName(anyString())).thenReturn(release); @@ -316,7 +316,7 @@ public void addDeploymentWithoutAppsWithVersionShouldObtainAppsWithVersionFromBo .thenReturn(deploymentEntity.getTrackingId()); when(environmentsService.getContextByName(deploymentEntity.getContext().getName())).thenReturn(deploymentEntity.getContext()); - when(deploymentBoundary.getFilteredDeployments(eq(0), eq(1), any(LinkedList.class), isNull(), isNull(), isNull())).thenReturn( + when(deploymentBoundary.getFilteredDeployments(eq(0), eq(1), any(LinkedList.class), isNull(), isNull())).thenReturn( new Tuple, Integer>(entities, entities.size())); when(releaseService.findByName(anyString())).thenReturn(release); when(generatorDomainServiceWithAppServerRelations.hasActiveNodeToDeployOnAtDate( @@ -348,7 +348,7 @@ public void addDeployment_no_active_node() { when(environmentsService.getContextByName(deploymentEntity.getContext().getName())).thenReturn(deploymentEntity.getContext()); when( deploymentBoundary.getFilteredDeployments(anyInt(), anyInt(), any(LinkedList.class), anyString(), - any(Sort.SortingDirectionType.class), any(LinkedList.class))).thenReturn( + any(Sort.SortingDirectionType.class))).thenReturn( new Tuple, Integer>(entities, entities.size())); when(releaseService.findByName(anyString())).thenReturn(release); @@ -368,7 +368,7 @@ public void addDeploymentWithOutRelease() { any(LinkedList.class), any(ArrayList.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean())).thenReturn( deploymentEntity.getTrackingId()); when(environmentsService.getContextByName(deploymentEntity.getContext().getName())).thenReturn(deploymentEntity.getContext()); - when(deploymentBoundary.getFilteredDeployments(eq(0), eq(1), any(LinkedList.class), isNull(), isNull(), isNull())).thenReturn( + when(deploymentBoundary.getFilteredDeployments(eq(0), eq(1), any(LinkedList.class), isNull(), isNull())).thenReturn( new Tuple, Integer>(entities, entities.size())); when(releaseService.findByName(null)).thenReturn(null); when(releaseService.loadAllReleases(false)).thenReturn(Collections.singletonList(release)); @@ -400,7 +400,7 @@ public void addDeploymentWrongAppName() { when(environmentsService.getContextByName(deploymentEntity.getContext().getName())).thenReturn(deploymentEntity.getContext()); when( deploymentBoundary.getFilteredDeployments(anyInt(), anyInt(), any(LinkedList.class), anyString(), - any(Sort.SortingDirectionType.class), any(LinkedList.class))).thenReturn( + any(Sort.SortingDirectionType.class))).thenReturn( new Tuple, Integer>(entities, entities.size())); when(releaseService.findByName(anyString())).thenReturn(release); @@ -422,7 +422,7 @@ public void addDeploymentNoAppInAs() { when(environmentsService.getContextByName(deploymentEntity.getContext().getName())).thenReturn(deploymentEntity.getContext()); when( deploymentBoundary.getFilteredDeployments(anyInt(), anyInt(), any(LinkedList.class), anyString(), - any(Sort.SortingDirectionType.class), any(LinkedList.class))).thenReturn( + any(Sort.SortingDirectionType.class))).thenReturn( new Tuple, Integer>(entities, entities.size())); //the as has no apps when(applicationServer.getAMWApplications()).thenReturn(new LinkedList()); @@ -452,7 +452,7 @@ public void addDeploymentNotAllAppsInRequest() { when(environmentsService.getContextByName(deploymentEntity.getContext().getName())).thenReturn(deploymentEntity.getContext()); when( deploymentBoundary.getFilteredDeployments(anyInt(), anyInt(), any(LinkedList.class), anyString(), - any(Sort.SortingDirectionType.class), any(LinkedList.class))).thenReturn( + any(Sort.SortingDirectionType.class))).thenReturn( new Tuple, Integer>(entities, entities.size())); when(releaseService.findByName(anyString())).thenReturn(release); @@ -526,7 +526,7 @@ public void getDeploymentsShouldAlsoReturnPreservedOne() { deploymentEntity.setExContextId(789); when(deploymentBoundary.getDeletedContextName(deploymentEntity)).thenReturn(formerEnvironmentName); Tuple, Integer> resultTuple = new Tuple, Integer>(new HashSet<>(Collections.singletonList(deploymentEntity)), 1); - when(deploymentBoundary.getFilteredDeployments(null, null, new LinkedList(), null, null, null)).thenReturn(resultTuple); + when(deploymentBoundary.getFilteredDeployments(null, null, new LinkedList(), null, null)).thenReturn(resultTuple); // when Response response = deploymentRestService.getDeployments(null, null, null, null, null, null, null, null, null, null, null, null, false);