Search in sources :

Example 1 with JpaModule

use of io.crnk.jpa.JpaModule in project crnk-framework by crnk-project.

the class QueryFactoryDiscoveryTest method checkJpaModuleIntegration.

@Test
public void checkJpaModuleIntegration() {
    TransactionRunner transactionRunner = Mockito.mock(TransactionRunner.class);
    EntityManager em = Mockito.mock(EntityManager.class);
    JpaModule module = JpaModule.newServerModule(em, transactionRunner);
    Assert.assertEquals(QuerydslQueryFactory.class, module.getQueryFactory().getClass());
}
Also used : EntityManager(javax.persistence.EntityManager) TransactionRunner(io.crnk.core.engine.transaction.TransactionRunner) JpaModule(io.crnk.jpa.JpaModule) Test(org.junit.Test)

Example 2 with JpaModule

use of io.crnk.jpa.JpaModule in project crnk-framework by crnk-project.

the class AbstractOperationsTest method setup.

@Before
public void setup() {
    client = new CrnkClient(getBaseUri().toString());
    client.setActionStubFactory(JerseyActionStubFactory.newInstance());
    client.getHttpAdapter().setReceiveTimeout(10000000, TimeUnit.MILLISECONDS);
    MetaModule metaModule = MetaModule.create();
    metaModule.addMetaProvider(new ResourceMetaProvider());
    client.addModule(metaModule);
    JpaModule module = JpaModule.newClientModule();
    setupModule(module, false);
    client.addModule(module);
    setNetworkTimeout(client, 10000, TimeUnit.SECONDS);
}
Also used : CrnkClient(io.crnk.client.CrnkClient) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) MetaModule(io.crnk.meta.MetaModule) JpaModule(io.crnk.jpa.JpaModule) Before(org.junit.Before)

Aggregations

JpaModule (io.crnk.jpa.JpaModule)2 CrnkClient (io.crnk.client.CrnkClient)1 TransactionRunner (io.crnk.core.engine.transaction.TransactionRunner)1 MetaModule (io.crnk.meta.MetaModule)1 ResourceMetaProvider (io.crnk.meta.provider.resource.ResourceMetaProvider)1 EntityManager (javax.persistence.EntityManager)1 Before (org.junit.Before)1 Test (org.junit.Test)1