Search in sources :

Example 6 with TestModule

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

the class JsonApiFormatTest method setup.

@Before
public void setup() {
    MetaModuleConfig config = new MetaModuleConfig();
    config.addMetaProvider(new ResourceMetaProvider());
    MetaModule metaModule = MetaModule.createServerModule(config);
    this.module = Mockito.spy(HomeModule.create(HomeFormat.JSON_API));
    boot = new CrnkBoot();
    boot.addModule(module);
    boot.addModule(metaModule);
    boot.addModule(new TestModule());
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.boot();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) MetaModule(io.crnk.meta.MetaModule) TestModule(io.crnk.test.mock.TestModule) MetaModuleConfig(io.crnk.meta.MetaModuleConfig) Before(org.junit.Before)

Example 7 with TestModule

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

the class JsonHomeFormatTest method setup.

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

Example 8 with TestModule

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

the class AbstractMetaTest method setup.

@Before
public void setup() {
    boot = new CrnkBoot();
    boot.addModule(new JaxrsModule(null));
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.addModule(new TestModule());
    boot.addModule(new io.crnk.test.mock.dynamic.DynamicModule());
    configure();
    boot.boot();
    resourceProvider = new ResourceMetaProvider();
    lookup = new MetaLookup();
    lookup.addProvider(resourceProvider);
    lookup.setModuleContext(boot.getModuleRegistry().getContext());
    lookup.initialize();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) JaxrsModule(io.crnk.rs.internal.JaxrsModule) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) TestModule(io.crnk.test.mock.TestModule) Before(org.junit.Before)

Example 9 with TestModule

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

the class MetaMetaTest method setup.

@Before
public void setup() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
    boot.addModule(new TestModule());
    resourceProvider = new ResourceMetaProvider();
    MetaModuleConfig moduleConfig = new MetaModuleConfig();
    moduleConfig.addMetaProvider(resourceProvider);
    MetaModule module = MetaModule.createServerModule(moduleConfig);
    boot.addModule(module);
    boot.boot();
    lookup = module.getLookup();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ResourceMetaProvider(io.crnk.meta.provider.resource.ResourceMetaProvider) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) 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