Search in sources :

Example 1 with TestEntityStatic

use of org.molgenis.data.staticentity.TestEntityStatic in project molgenis by molgenis.

the class DataServiceIT method testFindOneFetchTypedStatic.

@WithMockUser(username = USERNAME_READ)
@Test(groups = "readtest")
public void testFindOneFetchTypedStatic() {
    Entity entity = staticEntities.get(0);
    TestEntityStatic testEntityStatic = dataService.findOneById(entityTypeStatic.getId(), entity.getIdValue(), new Fetch().field(ATTR_ID), TestEntityStatic.class);
    assertNotNull(testEntityStatic);
    assertEquals(testEntityStatic.getIdValue(), entity.getIdValue());
}
Also used : TestEntityStatic(org.molgenis.data.staticentity.TestEntityStatic) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.testng.annotations.Test)

Example 2 with TestEntityStatic

use of org.molgenis.data.staticentity.TestEntityStatic in project molgenis by molgenis.

the class DataServiceIT method testFindOneQueryTypedStatic.

@WithMockUser(username = USERNAME_READ)
@Test(groups = "readtest")
public void testFindOneQueryTypedStatic() {
    Entity entity = staticEntities.get(0);
    TestEntityStatic testEntityStatic = dataService.findOne(entityTypeStatic.getId(), new QueryImpl<TestEntityStatic>().eq(ATTR_ID, entity.getIdValue()), TestEntityStatic.class);
    assertNotNull(testEntityStatic);
    assertEquals(testEntityStatic.getId(), entity.getIdValue());
}
Also used : AggregateQueryImpl(org.molgenis.data.support.AggregateQueryImpl) QueryImpl(org.molgenis.data.support.QueryImpl) TestEntityStatic(org.molgenis.data.staticentity.TestEntityStatic) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.testng.annotations.Test)

Example 3 with TestEntityStatic

use of org.molgenis.data.staticentity.TestEntityStatic in project molgenis by molgenis.

the class DataServiceIT method testFindOneTypedStatic.

@WithMockUser(username = USERNAME_READ)
@Test(groups = "readtest")
public void testFindOneTypedStatic() {
    Entity entity = staticEntities.get(0);
    TestEntityStatic testEntityStatic = dataService.findOneById(entityTypeStatic.getId(), entity.getIdValue(), TestEntityStatic.class);
    assertNotNull(testEntityStatic);
    assertEquals(testEntityStatic.getId(), entity.getIdValue());
}
Also used : TestEntityStatic(org.molgenis.data.staticentity.TestEntityStatic) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.testng.annotations.Test)

Aggregations

TestEntityStatic (org.molgenis.data.staticentity.TestEntityStatic)3 WithMockUser (org.springframework.security.test.context.support.WithMockUser)3 Test (org.testng.annotations.Test)3 AggregateQueryImpl (org.molgenis.data.support.AggregateQueryImpl)1 QueryImpl (org.molgenis.data.support.QueryImpl)1