Search in sources :

Example 1 with NamingTestEntity

use of io.crnk.jpa.model.NamingTestEntity in project crnk-framework by crnk-project.

the class AttributeNamingEndToEndTest method testCanStoreBasicAttributeValues.

@Test
public void testCanStoreBasicAttributeValues() throws InstantiationException, IllegalAccessException {
    ResourceRepositoryV2<NamingTestEntity, Serializable> repo = client.getRepositoryForType(NamingTestEntity.class);
    NamingTestEntity test = new NamingTestEntity();
    test.setId(1L);
    test.setSEcondUpperCaseValue(13L);
    repo.create(test);
    ResourceList<NamingTestEntity> list = repo.findAll(new QuerySpec(NamingTestEntity.class));
    Assert.assertEquals(1, list.size());
    NamingTestEntity saved = list.get(0);
    Assert.assertEquals(saved.getSEcondUpperCaseValue(), test.getSEcondUpperCaseValue());
}
Also used : Serializable(java.io.Serializable) QuerySpec(io.crnk.core.queryspec.QuerySpec) NamingTestEntity(io.crnk.jpa.model.NamingTestEntity) Test(org.junit.Test) AbstractJpaJerseyTest(io.crnk.jpa.AbstractJpaJerseyTest)

Aggregations

QuerySpec (io.crnk.core.queryspec.QuerySpec)1 AbstractJpaJerseyTest (io.crnk.jpa.AbstractJpaJerseyTest)1 NamingTestEntity (io.crnk.jpa.model.NamingTestEntity)1 Serializable (java.io.Serializable)1 Test (org.junit.Test)1