@Test public void testQueryBuilder() throws URISyntaxException, ClientProtocolException, IOException, ComponentLookupException { URI expectedURI = new URI("http: + "+AND+locus_type%3A%28RNA%2C%5C+cluster+RNA%2C%5C+micro*+%29" + "+%28+symbol%3A%28br%5C%3AcA*%29+alias_symbol%3A%28br%5C%5EcA*%29%29" + "+AND+%28+locus_group%3A%28non%5C-coding%5C+RNA%29%29+-%28+symbol%3A%28M*%29%29"); 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("NOTHING.json")); Map<String, Object> search = new LinkedHashMap<>(); search.put("status", "Approved"); search.put("locus_type", Arrays.asList("RNA, cluster", "RNA, micro*")); search.put("hgnc_id", Collections.emptyList()); Map<String, String> subquery = new LinkedHashMap<>(); subquery.put("symbol", "br:cA*"); subquery.put("alias_symbol", "br^cA*"); search.put("OR", subquery); subquery = new LinkedHashMap<>(); subquery.put("locus_group", "non-coding RNA"); search.put("AND", subquery); subquery = new LinkedHashMap<>(); subquery.put("symbol", "M*"); search.put("NOT", subquery); subquery = new LinkedHashMap<>(); subquery.put("what", "where"); search.put("DISCARD", subquery); this.mocker.getComponentUnderTest().search(search); Assert.assertEquals(expectedURI, reqCapture.getLastValue().getURI()); Assert.assertEquals("application/json", reqCapture.getLastValue().getLastHeader("Accept").getValue()); }
@Override public List<VocabularyTerm> search(Map<String, ?> fieldValues) { return search(fieldValues, Collections.<String, String>emptyMap()); }
RemoteGeneNomenclature implements Vocabulary, Initializable { @Override public List<VocabularyTerm> search(Map<String, ?> fieldValues) { return search(fieldValues, Collections.<String, String>emptyMap()); } }
RemoteGeneNomenclature implements Vocabulary, Initializable { @Override public List<VocabularyTerm> search(Map<String, ?> fieldValues) { return search(fieldValues, Collections.<String, String>emptyMap()); }  }
RemoteGeneNomenclature implements Vocabulary, Initializable { @Override public List<VocabularyTerm> search(Map<String, ?> fieldValues) { return search(fieldValues, Collections.<String, String>emptyMap()); }  @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 List<VocabularyTerm> search(Map<String, ?> fieldValues) { return search(fieldValues, Collections.<String, String>emptyMap()); }  @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();  }