### Question:
TargetTypesServiceImpl implements TargetTypesService { @Override public Collection<String> getTargetTypesNamesByDataSourceName(final String dataSourceName) { return targetTypesRepository.findByDataSourceName(dataSourceName); }  @Override Collection<String> getTargetTypesNamesByDataSourceName(final String dataSourceName); @Override List<TargetTypes> getAllTargetTypesByDomainList(final List<String> domains); @Override Page<TargetTypesProjections> getAllTargetTypeDetails(String searchTerm, int page, int size); @Override List<String> getAllTargetTypesCategories(); @Override List<TargetTypesDetails> getAllTargetTypes(List<AssetGroupTargetTypes> selectedTargetTypes); @Override List<TargetTypeAttribute> getTargetTypeAttributes(final List<TargetTypes> targetTypes); @Override Map<String, Object> getAttributeValues(AttributeValuesRequest attributeValuesRequest); @Override TargetTypes getTargetTypesByName(String targetTypeName); @Override String updateTargetTypeDetails(CreateUpdateTargetTypeDetailsRequest targetTypesDetails, final String userId); @Override String addTargetTypeDetails(final CreateUpdateTargetTypeDetailsRequest targetTypeDetailsRequest, final String userId); @Override void deleteIndex(String targetTypeIndex);  }### Answer:
@Test public void getAllAssetGroupNamesTest() { Collection<String> allTargetTypesNames = Lists.newArrayList(); allTargetTypesNames.add("TargetTypesName123"); when(targetTypesService.getTargetTypesNamesByDataSourceName(anyString())).thenReturn(allTargetTypesNames); assertThat(targetTypesRepository.findByDataSourceName(StringUtils.EMPTY), is(notNullValue())); }
@Test @SuppressWarnings("unchecked") public void getTargetTypesNamesByDataSourceNameTest() { when(targetTypesService.getAllTargetTypesByDomainList(anyList())).thenReturn(getTargetTypesDetailsList()); assertThat(targetTypesRepository.findByDomainIn(Lists.newArrayList()), is(notNullValue())); }