@Test public void testEnsemlFetchEnsemblEntry() throws IOException, ExternalDbUnavailableException, InterruptedException { String fetchRes = readFile("ensembl_lookup_id_ENSG00000106683.json"); Mockito.when( httpDataManager.fetchData(Mockito.any(), Mockito.any(ParameterNameValue[].class)) ).thenReturn(fetchRes); EnsemblEntryVO limk1Gene = ensemblDataManager.fetchEnsemblEntry("rs7412"); Assert.assertNotNull(limk1Gene); Assert.assertEquals("ENSG00000106683", limk1Gene.getId()); Assert.assertTrue(limk1Gene.getStart().equals(GENE_START)); Assert.assertTrue(limk1Gene.getEnd().equals(END)); Assert.assertEquals("GRCh38", limk1Gene.getAssemblyName()); Assert.assertEquals("LIMK1", limk1Gene.getDisplayName()); Assert.assertEquals("LIM domain kinase 1 [Source:HGNC Symbol;Acc:HGNC:6613]", limk1Gene.getDescription()); }
public EnsemblEntryVO fetchEnsemblEntry(String geneId) throws ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[]{ new ParameterNameValue(CONTENT_TYPE, APPLICATION_JSON), new ParameterNameValue(ENSEMBL_EXPAND_TOOL, "1"), new ParameterNameValue("utr", "1")}; String location = ENSEMBL_SERVER + ENSEMBL_TOOL + "/" + geneId + "?"; String geneData = httpDataManager.fetchData(location, params); EnsemblEntryVO ensemblEntryVO; try { ensemblEntryVO = objectMapper.readValue(geneData, EnsemblEntryVO.class); } catch (IOException e) { throw new ExternalDbUnavailableException("Unexpected result format", e); } return ensemblEntryVO; }
EnsemblDataManager { public EnsemblEntryVO fetchEnsemblEntry(String geneId) throws ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[]{ new ParameterNameValue(CONTENT_TYPE, APPLICATION_JSON), new ParameterNameValue(ENSEMBL_EXPAND_TOOL, "1"), new ParameterNameValue("utr", "1")}; String location = ENSEMBL_SERVER + ENSEMBL_TOOL + "/" + geneId + "?"; String geneData = httpDataManager.fetchData(location, params); EnsemblEntryVO ensemblEntryVO; try { ensemblEntryVO = objectMapper.readValue(geneData, EnsemblEntryVO.class); } catch (IOException e) { throw new ExternalDbUnavailableException("Unexpected result format", e); } return ensemblEntryVO; } }
EnsemblDataManager { public EnsemblEntryVO fetchEnsemblEntry(String geneId) throws ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[]{ new ParameterNameValue(CONTENT_TYPE, APPLICATION_JSON), new ParameterNameValue(ENSEMBL_EXPAND_TOOL, "1"), new ParameterNameValue("utr", "1")}; String location = ENSEMBL_SERVER + ENSEMBL_TOOL + "/" + geneId + "?"; String geneData = httpDataManager.fetchData(location, params); EnsemblEntryVO ensemblEntryVO; try { ensemblEntryVO = objectMapper.readValue(geneData, EnsemblEntryVO.class); } catch (IOException e) { throw new ExternalDbUnavailableException("Unexpected result format", e); } return ensemblEntryVO; }  }
EnsemblDataManager { public EnsemblEntryVO fetchEnsemblEntry(String geneId) throws ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[]{ new ParameterNameValue(CONTENT_TYPE, APPLICATION_JSON), new ParameterNameValue(ENSEMBL_EXPAND_TOOL, "1"), new ParameterNameValue("utr", "1")}; String location = ENSEMBL_SERVER + ENSEMBL_TOOL + "/" + geneId + "?"; String geneData = httpDataManager.fetchData(location, params); EnsemblEntryVO ensemblEntryVO; try { ensemblEntryVO = objectMapper.readValue(geneData, EnsemblEntryVO.class); } catch (IOException e) { throw new ExternalDbUnavailableException("Unexpected result format", e); } return ensemblEntryVO; }  EnsemblEntryVO fetchEnsemblEntry(String geneId); EnsemblVariationEntryVO fetchVariationEntry(String variationId, String species); List<EnsemblEntryVO> fetchVariationsOnRegion(String species, String chromosome,
                                                        String start, String finish); }
EnsemblDataManager { public EnsemblEntryVO fetchEnsemblEntry(String geneId) throws ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[]{ new ParameterNameValue(CONTENT_TYPE, APPLICATION_JSON), new ParameterNameValue(ENSEMBL_EXPAND_TOOL, "1"), new ParameterNameValue("utr", "1")}; String location = ENSEMBL_SERVER + ENSEMBL_TOOL + "/" + geneId + "?"; String geneData = httpDataManager.fetchData(location, params); EnsemblEntryVO ensemblEntryVO; try { ensemblEntryVO = objectMapper.readValue(geneData, EnsemblEntryVO.class); } catch (IOException e) { throw new ExternalDbUnavailableException("Unexpected result format", e); } return ensemblEntryVO; }  EnsemblEntryVO fetchEnsemblEntry(String geneId); EnsemblVariationEntryVO fetchVariationEntry(String variationId, String species); List<EnsemblEntryVO> fetchVariationsOnRegion(String species, String chromosome,
                                                        String start, String finish);  }