Search in sources :

Example 1 with ResourceModificationFilterBase

use of io.crnk.core.engine.filter.ResourceModificationFilterBase in project crnk-framework by crnk-project.

the class BaseControllerTest method prepare.

@Before
public void prepare() {
    modificationFilter = Mockito.spy(new ResourceModificationFilterBase());
    modificationFilters = Arrays.asList(modificationFilter);
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider(ResourceRegistryTest.TEST_MODELS_URL));
    boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
    boot.boot();
    objectMapper = boot.getObjectMapper();
    resourceRegistry = boot.getResourceRegistry();
    moduleRegistry = boot.getModuleRegistry();
    pathBuilder = new PathBuilder(resourceRegistry);
    typeParser = moduleRegistry.getTypeParser();
    documentMapper = boot.getDocumentMapper();
    MockRepositoryUtil.clear();
    emptyTaskQuery = new QuerySpecAdapter(new QuerySpec(Task.class), resourceRegistry);
    emptyProjectQuery = new QuerySpecAdapter(new QuerySpec(Project.class), resourceRegistry);
    emptyUserQuery = new QuerySpecAdapter(new QuerySpec(User.class), resourceRegistry);
    emptyComplexPojoQuery = new QuerySpecAdapter(new QuerySpec(ComplexPojo.class), resourceRegistry);
    emptyMemorandumQuery = new QuerySpecAdapter(new QuerySpec(Memorandum.class), resourceRegistry);
}
Also used : PathBuilder(io.crnk.core.engine.internal.dispatcher.path.PathBuilder) CrnkBoot(io.crnk.core.boot.CrnkBoot) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) ReflectionsServiceDiscovery(io.crnk.core.module.discovery.ReflectionsServiceDiscovery) ResourceModificationFilterBase(io.crnk.core.engine.filter.ResourceModificationFilterBase) QuerySpecAdapter(io.crnk.core.queryspec.internal.QuerySpecAdapter) QuerySpec(io.crnk.core.queryspec.QuerySpec) Before(org.junit.Before)

Aggregations

CrnkBoot (io.crnk.core.boot.CrnkBoot)1 ResourceModificationFilterBase (io.crnk.core.engine.filter.ResourceModificationFilterBase)1 PathBuilder (io.crnk.core.engine.internal.dispatcher.path.PathBuilder)1 ConstantServiceUrlProvider (io.crnk.core.engine.url.ConstantServiceUrlProvider)1 ReflectionsServiceDiscovery (io.crnk.core.module.discovery.ReflectionsServiceDiscovery)1 QuerySpec (io.crnk.core.queryspec.QuerySpec)1 QuerySpecAdapter (io.crnk.core.queryspec.internal.QuerySpecAdapter)1 Before (org.junit.Before)1