### Question:
MetadataService extends DatasourceService { public List<String> getMetadataDatasourceIds() { List<String> metadataIds = new ArrayList<String>(); try { sleep( 100 ); for ( String id : metadataDomainRepository.getDomainIds() ) { if ( isMetadataDatasource( id ) ) { metadataIds.add( id ); } } } catch ( InterruptedException e ) { e.printStackTrace(); } return metadataIds; } MetadataService(); static String getUploadDir(); void removeMetadata( String metadataId ); List<String> getMetadataDatasourceIds(); MetadataTempFilesListDto uploadMetadataFilesToTempDir( InputStream metadataFile,
      List<InputStream> localeFileStreams, List<String> localeFileNames ); MetadataTempFilesListDto uploadMetadataFilesToTempDir( InputStream metadataFile,
      List<FormDataBodyPart> localeFiles ); void importMetadataDatasource( String domainId, InputStream metadataFile,
                                        FormDataContentDisposition metadataFileInfo, boolean overwrite,
                                        List<FormDataBodyPart> localeFiles,
                                        List<FormDataContentDisposition> localeFilesInfo, RepositoryFileAclDto acl ); void importMetadataDatasource( String domainId, InputStream metadataFile, boolean overwrite,
      List<InputStream> localeFileStreams, List<String> localeFileNames, RepositoryFileAclDto acl ); boolean isContainsModel( String tempFileName ); void importMetadataFromTemp( String domainId, MetadataTempFilesListDto fileList,
      boolean overwrite, RepositoryFileAclDto acl ); RepositoryFileAclDto getMetadataAcl( String domainId ); void setMetadataAcl( String domainId, RepositoryFileAclDto aclDto ); static RepositoryFileImportBundle createNewRepositoryFileImportBundle( InputStream bais, String fileName, String domainId );  }### Answer:
@Test public void testGetMetadataDatasourceIds() throws Exception { List<String> mockMetadataIdsList = new ArrayList<String>(); Set<String> mockSet = new HashSet<String>(); mockSet.add( "domainId1" ); mockMetadataIdsList.add( "domainId1" ); doReturn( true ).when( metadataService ).isMetadataDatasource( "domainId1" ); doReturn( mockSet ).when( metadataService.metadataDomainRepository ).getDomainIds(); List<String> response = metadataService.getMetadataDatasourceIds(); verify( metadataService, times( 1 ) ).getMetadataDatasourceIds(); assertEquals( mockMetadataIdsList, response ); }