Search in sources :

Example 1 with TestModule

use of io.crnk.test.mock.TestModule in project crnk-framework by crnk-project.

the class ActivitiTestBase method setup.

@Before
public void setup() {
    processEngine = ProcessEngines.getDefaultProcessEngine();
    processEngine.getRepositoryService().createDeployment().addClasspathResource("approval.bpmn20.xml").deploy();
    boot = new CrnkBoot();
    boot.addModule(new TestModule());
    boot.addModule(createActivitiModule());
    boot.boot();
    taskRepository = (TaskResourceRepository<ApproveTask>) boot.getResourceRegistry().getEntry(ApproveTask.class).getResourceRepository().getResourceRepository();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) TestModule(io.crnk.test.mock.TestModule) ApproveTask(io.crnk.activiti.example.model.ApproveTask) Before(org.junit.Before)

Example 2 with TestModule

use of io.crnk.test.mock.TestModule in project crnk-framework by crnk-project.

the class HomeResourceFilteringTest method setup.

@Before
public void setup() {
    filter = Mockito.mock(ResourceFilter.class);
    SimpleModule filterModule = new SimpleModule("filter");
    filterModule.addResourceFilter(filter);
    this.module = Mockito.spy(HomeModule.create());
    boot = new CrnkBoot();
    boot.addModule(module);
    boot.addModule(new TestModule());
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.addModule(filterModule);
    boot.boot();
}
Also used : ResourceFilter(io.crnk.core.engine.filter.ResourceFilter) CrnkBoot(io.crnk.core.boot.CrnkBoot) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) TestModule(io.crnk.test.mock.TestModule) SimpleModule(io.crnk.core.module.SimpleModule) Before(org.junit.Before)

Example 3 with TestModule

use of io.crnk.test.mock.TestModule in project crnk-framework by crnk-project.

the class HomeModuleTest method setup.

@Before
public void setup() {
    this.module = Mockito.spy(HomeModule.create(HomeFormat.JSON_HOME));
    boot = new CrnkBoot();
    boot.addModule(module);
    boot.addModule(new TestModule());
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.boot();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) TestModule(io.crnk.test.mock.TestModule) Before(org.junit.Before)

Example 4 with TestModule

use of io.crnk.test.mock.TestModule in project crnk-framework by crnk-project.

the class ClientDocumentMapperTest method setup.

@Before
public void setup() {
    boot = new CrnkBoot();
    boot.addModule(new TestModule());
    boot.boot();
    NullPropertiesProvider properties = new NullPropertiesProvider();
    documentMapper = new ClientDocumentMapper(boot.getModuleRegistry(), boot.getObjectMapper(), properties);
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) NullPropertiesProvider(io.crnk.core.engine.properties.NullPropertiesProvider) TestModule(io.crnk.test.mock.TestModule) Before(org.junit.Before)

Example 5 with TestModule

use of io.crnk.test.mock.TestModule in project crnk-framework by crnk-project.

the class ClientResourceUpsertTest method setup.

@Before
public void setup() {
    boot = new CrnkBoot();
    boot.addModule(new TestModule());
    boot.boot();
    PropertiesProvider propertiesProvider = new NullPropertiesProvider();
    ClientProxyFactory proxyFactory = Mockito.mock(ClientProxyFactory.class);
    upsert = new ClientResourceUpsert(boot.getResourceRegistry(), propertiesProvider, boot.getModuleRegistry().getTypeParser(), boot.getObjectMapper(), boot.getDocumentMapper(), proxyFactory);
}
Also used : PropertiesProvider(io.crnk.core.engine.properties.PropertiesProvider) NullPropertiesProvider(io.crnk.core.engine.properties.NullPropertiesProvider) CrnkBoot(io.crnk.core.boot.CrnkBoot) ClientProxyFactory(io.crnk.client.internal.proxy.ClientProxyFactory) NullPropertiesProvider(io.crnk.core.engine.properties.NullPropertiesProvider) TestModule(io.crnk.test.mock.TestModule) Before(org.junit.Before)

Aggregations

CrnkBoot (io.crnk.core.boot.CrnkBoot)9 TestModule (io.crnk.test.mock.TestModule)9 Before (org.junit.Before)9 ConstantServiceUrlProvider (io.crnk.core.engine.url.ConstantServiceUrlProvider)6 ResourceMetaProvider (io.crnk.meta.provider.resource.ResourceMetaProvider)4 NullPropertiesProvider (io.crnk.core.engine.properties.NullPropertiesProvider)2 MetaModule (io.crnk.meta.MetaModule)2 MetaModuleConfig (io.crnk.meta.MetaModuleConfig)2 ApproveTask (io.crnk.activiti.example.model.ApproveTask)1 ClientProxyFactory (io.crnk.client.internal.proxy.ClientProxyFactory)1 ResourceFilter (io.crnk.core.engine.filter.ResourceFilter)1 PropertiesProvider (io.crnk.core.engine.properties.PropertiesProvider)1 SimpleModule (io.crnk.core.module.SimpleModule)1 JaxrsModule (io.crnk.rs.internal.JaxrsModule)1