use of org.molgenis.data.Entity in project molgenis by molgenis.
the class FairControllerTest method getCatalogTestUnknownCatalog.
@Test
public void getCatalogTestUnknownCatalog() throws Exception {
reset(dataService);
Entity answer = mock(Entity.class);
this.mockMvc.perform(get(URI.create("http://molgenis01.gcc.rug.nl:8080/fdp/catalogID?blah=value")).contentType(MediaType.APPLICATION_FORM_URLENCODED)).andExpect(status().isBadRequest());
}
use of org.molgenis.data.Entity in project molgenis by molgenis.
the class FairControllerTest method getCatalogTest.
@Test
public void getCatalogTest() throws Exception {
reset(dataService);
Entity answer = mock(Entity.class);
when(dataService.findOneById("fdp_Catalog", "catalogID")).thenReturn(answer);
this.mockMvc.perform(get(URI.create("http://molgenis01.gcc.rug.nl:8080/fdp/catalogID?blah=value")).contentType(MediaType.APPLICATION_FORM_URLENCODED)).andExpect(status().isOk());
Mockito.verify(entityModelWriter).createRdfModel("http://molgenis01.gcc.rug.nl:8080/fdp/catalogID", answer);
}
use of org.molgenis.data.Entity in project molgenis by molgenis.
the class QueryImplTest method setFetch.
@Test
public void setFetch() {
Fetch fetch = new Fetch();
QueryImpl<Entity> q = new QueryImpl<>();
q.setFetch(fetch);
assertEquals(fetch, q.getFetch());
}
use of org.molgenis.data.Entity in project molgenis by molgenis.
the class QueryImplTest method nest.
@Test
public void nest() {
Query<Entity> q = new QueryImpl<>().nest().eq("field", "value").unnest();
QueryRule expectedRule = new QueryRule(Arrays.asList(new QueryRule("field", Operator.EQUALS, "value")));
assertEquals(q.getRules(), Arrays.asList(expectedRule));
}
use of org.molgenis.data.Entity in project molgenis by molgenis.
the class QueryImplTest method rng.
@Test
public void rng() {
Query<Entity> q = new QueryImpl<>().rng("field", "min", "max");
QueryRule expectedRule = new QueryRule("field", Operator.RANGE, Arrays.asList("min", "max"));
assertEquals(q.getRules(), Arrays.asList(expectedRule));
}
Aggregations