### Question:
SdxService implements ResourceIdProvider, ResourceBasedCrnProvider { public List<SdxCluster> listSdxByEnvCrn(String userCrn, String envCrn) { LOGGER.info("Listing SDX clusters by environment crn {}", envCrn); String accountIdFromCrn = getAccountIdFromCrn(userCrn); return sdxClusterRepository.findByAccountIdAndEnvCrnAndDeletedIsNull(accountIdFromCrn, envCrn); }  String getStackCrnByClusterCrn(String crn); Set<Long> findByResourceIdsAndStatuses(Set<Long> resourceIds, Set<DatalakeStatusEnum> statuses); SdxCluster getById(Long id); StackV4Response getDetail(String name, Set<String> entries, String accountId); SdxCluster getByCrn(String userCrn, String clusterCrn); SdxCluster getByNameInAccount(String userCrn, String name); Pair<SdxCluster, FlowIdentifier> createSdx(final String userCrn, final String name, final SdxClusterRequest sdxClusterRequest,
            final StackV4Request internalStackV4Request); FlowIdentifier sync(String name, String accountId); void syncByCrn(String userCrn, String crn); @Override Long getResourceIdByResourceCrn(String resourceCrn); @Override Long getResourceIdByResourceName(String resourceName); List<SdxCluster> listSdxByEnvCrn(String userCrn, String envCrn); List<SdxCluster> listSdxByEnvCrn(String envCrn); List<SdxCluster> listSdx(String userCrn, String envName); FlowIdentifier deleteSdxByClusterCrn(String userCrn, String clusterCrn, boolean forced); FlowIdentifier deleteSdx(String userCrn, String name, boolean forced); void updateRuntimeVersionFromStackResponse(SdxCluster sdxCluster, StackV4Response stackV4Response); String getAccountIdFromCrn(String crnStr); @Override String getResourceCrnByResourceName(String resourceName); @Override List<String> getResourceCrnListByResourceNameList(List<String> resourceNames); @Override List<String> getResourceCrnsInAccount(); @Override Optional<String> getEnvironmentCrnByResourceCrn(String resourceCrn); @Override AuthorizationResourceType getResourceType(); SdxCluster save(SdxCluster sdxCluster);  }### Answer:
@Test void testListSdxClustersWhenEnvironmentCrnProvidedAndTwoSdxIsInTheDatabaseShouldListAllSdxClusterWhichIsTwo() { List<SdxCluster> sdxClusters = List.of(new SdxCluster(), new SdxCluster()); when(sdxClusterRepository.findByAccountIdAndEnvCrnAndDeletedIsNull(eq("hortonworks"), eq(ENVIRONMENT_CRN))).thenReturn(sdxClusters); List<SdxCluster> sdxList = underTest.listSdxByEnvCrn(USER_CRN, ENVIRONMENT_CRN); assertEquals(2, sdxList.size()); }