@Test public void getApplicationsTest() throws Exception { when(repository.getListOfApplications(anyString(),anyString())) .thenReturn(CommonTestUtil.getAssetCountByApps()); assertThat(filterServiceImpl.getApplications("dummyString","testString"), is(notNullValue())); when(repository.getListOfApplications(anyString(),anyString())).thenThrow(new DataException()); assertThatThrownBy( () -> filterServiceImpl.getApplications("dummyString","qwe")).isInstanceOf(ServiceException.class); }
public List<Map<String, Object>> getApplications(String assetGroup, String domain) throws ServiceException { AssetCountDTO[] assetCountByApps; try{assetCountByApps = repository.getListOfApplications(assetGroup, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByApps, emptyList); return getAssetCountByAppOrEnv(assetCountByApps); }
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getApplications(String assetGroup, String domain) throws ServiceException { AssetCountDTO[] assetCountByApps; try{assetCountByApps = repository.getListOfApplications(assetGroup, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByApps, emptyList); return getAssetCountByAppOrEnv(assetCountByApps); } }
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getApplications(String assetGroup, String domain) throws ServiceException { AssetCountDTO[] assetCountByApps; try{assetCountByApps = repository.getListOfApplications(assetGroup, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByApps, emptyList); return getAssetCountByAppOrEnv(assetCountByApps); }  }
FilterServiceImpl implements FilterService, Constants { public List<Map<String, Object>> getApplications(String assetGroup, String domain) throws ServiceException { AssetCountDTO[] assetCountByApps; try{assetCountByApps = repository.getListOfApplications(assetGroup, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByApps, emptyList); return getAssetCountByAppOrEnv(assetCountByApps); }  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>> getApplications(String assetGroup, String domain) throws ServiceException { AssetCountDTO[] assetCountByApps; try{assetCountByApps = repository.getListOfApplications(assetGroup, domain); }catch(DataException e){ throw new ServiceException(e); } noDataFoundCheck(assetCountByApps, emptyList); return getAssetCountByAppOrEnv(assetCountByApps); }  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);  }