Commit 9dbcc830 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

homo sapiens was changed into homo sapien in ncbi database

parent 9e3652a5
......@@ -30,7 +30,7 @@ public class TaxonomyBackendTest extends AnnotationTestFunctions {
@Autowired
TaxonomyBackend taxonomyBackend;
@Autowired
private GeneralCacheInterface cache;
private GeneralCacheInterface cache;
@Test
public void testByName() throws Exception {
......@@ -92,7 +92,8 @@ public class TaxonomyBackendTest extends AnnotationTestFunctions {
public void testGetName() throws Exception {
try {
String name = taxonomyBackend.getNameForTaxonomy(new MiriamData(MiriamType.TAXONOMY, "9606"));
assertTrue(name.contains("Homo sapiens"));
logger.debug(name);
assertTrue("Taxonomy id should refer to homo sapien, but this found: " + name, name.contains("Homo sapien"));
assertNotNull(taxonomyBackend.getNameForTaxonomy(new MiriamData(MiriamType.TAXONOMY, "9605")));
} catch (Exception e) {
e.printStackTrace();
......@@ -105,7 +106,8 @@ public class TaxonomyBackendTest extends AnnotationTestFunctions {
WebPageDownloader downloader = taxonomyBackend.getWebPageDownloader();
try {
WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
when(mockDownloader.getFromNetwork(anyString(), anyString(), nullable(String.class))).thenThrow(new IOException());
when(mockDownloader.getFromNetwork(anyString(), anyString(), nullable(String.class)))
.thenThrow(new IOException());
taxonomyBackend.setWebPageDownloader(mockDownloader);
taxonomyBackend.setCache(null);
taxonomyBackend.getNameForTaxonomy(new MiriamData(MiriamType.TAXONOMY, "9606"));
......@@ -249,10 +251,11 @@ public class TaxonomyBackendTest extends AnnotationTestFunctions {
WebPageDownloader downloader = taxonomyBackend.getWebPageDownloader();
try {
WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
when(mockDownloader.getFromNetwork(anyString(), anyString(), nullable(String.class))).thenThrow(new IOException());
when(mockDownloader.getFromNetwork(anyString(), anyString(), nullable(String.class)))
.thenThrow(new IOException());
taxonomyBackend.setWebPageDownloader(mockDownloader);
taxonomyBackend.setCache(null);
taxonomyBackend.refreshCacheQuery("http://google.pl/");
fail("Exception expected");
} catch (SourceNotAvailable e) {
......@@ -280,7 +283,8 @@ public class TaxonomyBackendTest extends AnnotationTestFunctions {
WebPageDownloader downloader = taxonomyBackend.getWebPageDownloader();
try {
WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
when(mockDownloader.getFromNetwork(anyString(), anyString(), nullable(String.class))).thenThrow(new IOException());
when(mockDownloader.getFromNetwork(anyString(), anyString(), nullable(String.class)))
.thenThrow(new IOException());
taxonomyBackend.setWebPageDownloader(mockDownloader);
assertEquals(ExternalServiceStatusType.DOWN, taxonomyBackend.getServiceStatus().getStatus());
} catch (Exception e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment