### Question:
DatasetImporterForRegistry extends NodeBasedImporter { @Override public void importStudy() throws StudyImporterException { Collection<String> namespaces; try { namespaces = getRegistry().findNamespaces(); } catch (DatasetRegistryException e) { throw new StudyImporterException("failed to discover datasets", e); } List<String> repositoriesWithIssues = new ArrayList<>(); for (String namespace : namespaces) { try { importData(namespace); } catch (StudyImporterException e) { repositoriesWithIssues.add(namespace); } } if (repositoriesWithIssues.size() > 0) { throw new StudyImporterException("failed to import one or more repositories: [" + StringUtils.join(repositoriesWithIssues, ", ") + "]"); } } DatasetImporterForRegistry(ParserFactory parserFactory, NodeFactory nodeFactory, DatasetRegistry registry); @Override void importStudy(); void importData(Dataset dataset);  }### Answer:
@Test(expected = StudyImporterException.class) public void throwOnMissingConfig() throws StudyImporterException { DatasetImporterForRegistry importer = new DatasetImporterForRegistry(null, null, new DatasetRegistry() { @Override public Collection<String> findNamespaces() throws DatasetRegistryException { return Collections.singletonList("some/namespace"); } @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { return new DatasetImpl("some/namespace", URI.create("some:uri"), in -> in); } }); try { importer.importStudy(); } catch(StudyImporterException ex) { assertThat(ex.getMessage(), Is.is("failed to import one or more repositories: [some/namespace]")); throw ex; } }