Search in sources :

Example 16 with PropertiesProvider

use of io.crnk.core.engine.properties.PropertiesProvider 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)

Example 17 with PropertiesProvider

use of io.crnk.core.engine.properties.PropertiesProvider in project crnk-framework by crnk-project.

the class ResourceRepositoryBaseTest method setup.

@Before
public void setup() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
    boot.setPropertiesProvider(new PropertiesProvider() {

        @Override
        public String getProperty(String key) {
            if (key.equals(CrnkProperties.RETURN_404_ON_NULL)) {
                return "true";
            }
            return null;
        }
    });
    boot.boot();
    repository = new TestRepository();
    repository.setResourceRegistry(boot.getResourceRegistry());
}
Also used : PropertiesProvider(io.crnk.core.engine.properties.PropertiesProvider) CrnkBoot(io.crnk.core.boot.CrnkBoot) ReflectionsServiceDiscovery(io.crnk.core.module.discovery.ReflectionsServiceDiscovery) Before(org.junit.Before)

Aggregations

PropertiesProvider (io.crnk.core.engine.properties.PropertiesProvider)17 Test (org.junit.Test)13 Document (io.crnk.core.engine.document.Document)5 Resource (io.crnk.core.engine.document.Resource)5 NullPropertiesProvider (io.crnk.core.engine.properties.NullPropertiesProvider)5 CrnkBoot (io.crnk.core.boot.CrnkBoot)4 BaseControllerTest (io.crnk.core.engine.internal.dispatcher.controller.BaseControllerTest)3 ResourcePost (io.crnk.core.engine.internal.dispatcher.controller.ResourcePost)3 JsonPath (io.crnk.core.engine.internal.dispatcher.path.JsonPath)3 AbstractDocumentMapperTest (io.crnk.core.engine.internal.document.mapper.AbstractDocumentMapperTest)3 ConstantServiceUrlProvider (io.crnk.core.engine.url.ConstantServiceUrlProvider)3 SampleJsonServiceLocator (io.crnk.legacy.locator.SampleJsonServiceLocator)3 DocumentMapper (io.crnk.core.engine.internal.document.mapper.DocumentMapper)2 EmptyPropertiesProvider (io.crnk.core.engine.properties.EmptyPropertiesProvider)2 HierarchicalTask (io.crnk.core.mock.models.HierarchicalTask)2 Task (io.crnk.core.mock.models.Task)2 ReflectionsServiceDiscovery (io.crnk.core.module.discovery.ReflectionsServiceDiscovery)2 QuerySpec (io.crnk.core.queryspec.QuerySpec)2 Before (org.junit.Before)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1