Search in sources :

Example 1 with RenamedTestEntity

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

the class JpaMetaEndToEndTest method testRenameResourceType.

@Test
public void testRenameResourceType() {
    MetaResource metaResource = resourceMetaProvider.getMeta(RenamedTestEntity.class);
    Assert.assertEquals("renamedResource", metaResource.getResourceType());
    RenamedTestEntity test = new RenamedTestEntity();
    test.setId(1L);
    ResourceRepositoryV2<RenamedTestEntity, Serializable> repository = client.getRepositoryForType(RenamedTestEntity.class);
    repository.create(test);
    Assert.assertEquals(1, repository.findAll(new QuerySpec(RenamedTestEntity.class)).size());
    repository.delete(1L);
    Assert.assertEquals(0, repository.findAll(new QuerySpec(RenamedTestEntity.class)).size());
}
Also used : Serializable(java.io.Serializable) MetaResource(io.crnk.meta.model.resource.MetaResource) RenamedTestEntity(io.crnk.jpa.model.RenamedTestEntity) QuerySpec(io.crnk.core.queryspec.QuerySpec) Test(org.junit.Test) AbstractJpaJerseyTest(io.crnk.jpa.AbstractJpaJerseyTest)

Aggregations

QuerySpec (io.crnk.core.queryspec.QuerySpec)1 AbstractJpaJerseyTest (io.crnk.jpa.AbstractJpaJerseyTest)1 RenamedTestEntity (io.crnk.jpa.model.RenamedTestEntity)1 MetaResource (io.crnk.meta.model.resource.MetaResource)1 Serializable (java.io.Serializable)1 Test (org.junit.Test)1