Commit 0dbaa2fa authored by Piotr Gawron's avatar Piotr Gawron

Merge branch 'pubmed-api-updated' into 'devel_14.0.x'

pubmed api updated

See merge request !1150
parents e9d017ac 786ba48b
Pipeline #27513 passed with stage
in 15 minutes and 19 seconds
......@@ -43,7 +43,7 @@ public class PubmedParser extends CachableInterface implements IExternalService
/**
* Version of the remote API that is supported by this connecting class.
*/
static final String SUPPORTED_VERSION = "6.2";
static final String SUPPORTED_VERSION = "6.3";
static final String API_URL = "https://www.ebi.ac.uk/europepmc/webservices/rest/";
/**
* Length of {@link #PUBMED_PREFIX} string.
......
......@@ -53,45 +53,6 @@ public class DrugServiceTest extends ServiceTestFunctions {
}
}
@Test
public void testGetTargets() throws Exception {
long count = searchHistoryDao.getCount();
Model model = new ModelFullIndexed(null);
Project project = new Project();
project.setOwner(userDao.getUserByLogin(ADMIN_BUILT_IN_LOGIN));
project.setProjectId("TesT");
project.addModel(model);
Drug drug = drugService.getByName("Diazoxide", new DbSearchCriteria().project(project).ipAddress("ip"));
assertNotNull(drug);
assertNotNull(drug.getName());
assertFalse(drug.getName().trim().equals(""));
assertNotNull(drug.getDescription());
assertFalse(drug.getDescription().trim().equals(""));
String hgnc1 = "SLC12A3";
String hgnc2 = "KCNJ8";
boolean hgnc1Exists = false;
boolean hgnc2Exists = false;
for (Target target : drug.getTargets()) {
for (MiriamData row : target.getGenes()) {
if (row.getResource().equalsIgnoreCase(hgnc1))
hgnc1Exists = true;
if (row.getResource().equalsIgnoreCase(hgnc2))
hgnc2Exists = true;
}
}
assertTrue("Target " + hgnc1 + " doesn't exist in target list but should", hgnc1Exists);
assertTrue("Target " + hgnc2 + " doesn't exist in target list but should", hgnc2Exists);
long count2 = searchHistoryDao.getCount();
assertEquals(count + 1, count2);
assertEquals("YES", drug.getBloodBrainBarrier());
}
@Test
public void testGetTargetsBySynonym() throws Exception {
......
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