@Test public void getEnvironmentsByAssetGroupTest() throws Exception { when(repository.getListOfEnvironments(anyString(),anyString(),anyString())) .thenReturn(CommonTestUtil.getAssetCountByApps()); assertThat(filterServiceImpl.getEnvironmentsByAssetGroup("dummyString","testString","testString"), is(notNullValue())); when(repository.getListOfEnvironments(anyString(),anyString(),anyString())).thenThrow(new DataException()); assertThatThrownBy( () -> filterServiceImpl.getEnvironmentsByAssetGroup("dummyString","qwe","qwe")).isInstanceOf(ServiceException.class); }
public List<Map<String, Object>> getEnvironmentsByAssetGroup( String assetGroup, String application, String domain) throws ServiceException { AssetCountDTO[] assetCountByEnvs; try{ assetCountByEnvs = repository.getListOfEnvironments(assetGroup, application, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByEnvs, null); return getAssetCountByAppOrEnv(assetCountByEnvs); }
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getEnvironmentsByAssetGroup( String assetGroup, String application, String domain) throws ServiceException { AssetCountDTO[] assetCountByEnvs; try{ assetCountByEnvs = repository.getListOfEnvironments(assetGroup, application, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByEnvs, null); return getAssetCountByAppOrEnv(assetCountByEnvs); } }
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getEnvironmentsByAssetGroup( String assetGroup, String application, String domain) throws ServiceException { AssetCountDTO[] assetCountByEnvs; try{ assetCountByEnvs = repository.getListOfEnvironments(assetGroup, application, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByEnvs, null); return getAssetCountByAppOrEnv(assetCountByEnvs); }  }
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getEnvironmentsByAssetGroup( String assetGroup, String application, String domain) throws ServiceException { AssetCountDTO[] assetCountByEnvs; try{ assetCountByEnvs = repository.getListOfEnvironments(assetGroup, application, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByEnvs, null); return getAssetCountByAppOrEnv(assetCountByEnvs); }  List<Map<String, Object>> getFilters(int filterId, String domain); List<Map<String, Object>> getPolicies(String assetGroup,
            String domain); List<Map<String, Object>> getRegions(String assetGroup); List<Map<String, Object>> getAccounts(String assetGroup); List<Map<String, Object>> getRules(String assetGroup, String domain); List<Map<String, Object>> getApplications(String assetGroup,
            String domain); List<Map<String, Object>> getEnvironmentsByAssetGroup(
            String assetGroup, String application, String domain); List<Map<String, Object>> getTargetTypesForAssetGroup(
            String assetGroup, String domain); }
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getEnvironmentsByAssetGroup( String assetGroup, String application, String domain) throws ServiceException { AssetCountDTO[] assetCountByEnvs; try{ assetCountByEnvs = repository.getListOfEnvironments(assetGroup, application, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByEnvs, null); return getAssetCountByAppOrEnv(assetCountByEnvs); }  List<Map<String, Object>> getFilters(int filterId, String domain); List<Map<String, Object>> getPolicies(String assetGroup,
            String domain); List<Map<String, Object>> getRegions(String assetGroup); List<Map<String, Object>> getAccounts(String assetGroup); List<Map<String, Object>> getRules(String assetGroup, String domain); List<Map<String, Object>> getApplications(String assetGroup,
            String domain); List<Map<String, Object>> getEnvironmentsByAssetGroup(
            String assetGroup, String application, String domain); List<Map<String, Object>> getTargetTypesForAssetGroup(
            String assetGroup, String domain);  }