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