@Test public void getVersionFetchesFromRemoteServer() throws ComponentLookupException, URISyntaxException, ClientProtocolException, IOException { URI expectedURI = new URI("http: CapturingMatcher<HttpUriRequest> reqCapture = new CapturingMatcher<>(); when(this.client.execute(Matchers.argThat(reqCapture))).thenReturn(this.response); when(this.response.getEntity()).thenReturn(this.responseEntity); when(this.responseEntity.getContent()).thenReturn(ClassLoader.getSystemResourceAsStream("info.json")); String result = this.mocker.getComponentUnderTest().getVersion(); Assert.assertEquals(expectedURI, reqCapture.getLastValue().getURI()); Assert.assertEquals("application/json", reqCapture.getLastValue().getLastHeader("Accept").getValue()); Assert.assertEquals("2014-09-01T04:42:14.649Z", result); }
@Override public String getVersion() { JSONObject info = getInfo(); return info == null ? "" : info.getString("lastModified"); }
RemoteGeneNomenclature implements Vocabulary, Initializable { @Override public String getVersion() { JSONObject info = getInfo(); return info == null ? "" : info.getString("lastModified"); } }
RemoteGeneNomenclature implements Vocabulary, Initializable { @Override public String getVersion() { JSONObject info = getInfo(); return info == null ? "" : info.getString("lastModified"); }  }
RemoteGeneNomenclature implements Vocabulary, Initializable { @Override public String getVersion() { JSONObject info = getInfo(); return info == null ? "" : info.getString("lastModified"); }  @Override void initialize(); @Override VocabularyTerm getTerm(String id); @Override Set<VocabularyTerm> getTerms(Collection<String> ids); @Override List<VocabularyTerm> search(Map<String, ?> fieldValues); @Override List<VocabularyTerm> search(Map<String, ?> fieldValues, Map<String, String> queryOptions); @Override List<VocabularyTerm> search(String input); @Override List<VocabularyTerm> search(String input, int maxResults, String sort, String customFilter); @Override long count(Map<String, ?> fieldValues); @Override long getDistance(String fromTermId, String toTermId); @Override long getDistance(VocabularyTerm fromTerm, VocabularyTerm toTerm); @Override String getIdentifier(); @Override String getName(); @Override Set<String> getAliases(); @Override Collection<String> getSupportedCategories(); @Override String getWebsite(); @Override String getCitation(); @Override long size(); @Override int reindex(String ontologyUrl); @Override String getDefaultSourceLocation(); @Override String getVersion(); @Override List<VocabularyExtension> getExtensions(); }
RemoteGeneNomenclature implements Vocabulary, Initializable { @Override public String getVersion() { JSONObject info = getInfo(); return info == null ? "" : info.getString("lastModified"); }  @Override void initialize(); @Override VocabularyTerm getTerm(String id); @Override Set<VocabularyTerm> getTerms(Collection<String> ids); @Override List<VocabularyTerm> search(Map<String, ?> fieldValues); @Override List<VocabularyTerm> search(Map<String, ?> fieldValues, Map<String, String> queryOptions); @Override List<VocabularyTerm> search(String input); @Override List<VocabularyTerm> search(String input, int maxResults, String sort, String customFilter); @Override long count(Map<String, ?> fieldValues); @Override long getDistance(String fromTermId, String toTermId); @Override long getDistance(VocabularyTerm fromTerm, VocabularyTerm toTerm); @Override String getIdentifier(); @Override String getName(); @Override Set<String> getAliases(); @Override Collection<String> getSupportedCategories(); @Override String getWebsite(); @Override String getCitation(); @Override long size(); @Override int reindex(String ontologyUrl); @Override String getDefaultSourceLocation(); @Override String getVersion(); @Override List<VocabularyExtension> getExtensions();  }