Search in sources :

Example 1 with QueryAdapterBuilder

use of io.crnk.core.engine.query.QueryAdapterBuilder in project crnk-framework by crnk-project.

the class CrnkBootTest method setQueryParamsBuilder.

@Test
public void setQueryParamsBuilder() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceDiscoveryFactory(serviceDiscoveryFactory);
    boot.setDefaultServiceUrlProvider(mock(ServiceUrlProvider.class));
    QueryParamsBuilder deserializer = mock(QueryParamsBuilder.class);
    boot.setQueryParamsBuilds(deserializer);
    boot.boot();
    HttpRequestProcessorImpl requestDispatcher = boot.getRequestDispatcher();
    QueryAdapterBuilder queryAdapterBuilder = requestDispatcher.getQueryAdapterBuilder();
    Assert.assertTrue(queryAdapterBuilder instanceof QueryParamsAdapterBuilder);
}
Also used : ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) ServiceUrlProvider(io.crnk.core.engine.url.ServiceUrlProvider) QueryParamsBuilder(io.crnk.legacy.queryParams.QueryParamsBuilder) QueryParamsAdapterBuilder(io.crnk.legacy.internal.QueryParamsAdapterBuilder) HttpRequestProcessorImpl(io.crnk.core.engine.internal.http.HttpRequestProcessorImpl) QueryAdapterBuilder(io.crnk.core.engine.query.QueryAdapterBuilder) Test(org.junit.Test)

Example 2 with QueryAdapterBuilder

use of io.crnk.core.engine.query.QueryAdapterBuilder in project crnk-framework by crnk-project.

the class CrnkBoot method createRequestDispatcher.

private HttpRequestProcessorImpl createRequestDispatcher(ExceptionMapperRegistry exceptionMapperRegistry) {
    ControllerRegistryBuilder controllerRegistryBuilder = newControllerRegistryBuilder(resourceRegistry, moduleRegistry.getTypeParser(), objectMapper, propertiesProvider, moduleRegistry.getContext().getResourceFilterDirectory(), moduleRegistry.getResourceModificationFilters());
    ControllerRegistry controllerRegistry = controllerRegistryBuilder.build();
    this.documentMapper = controllerRegistryBuilder.getDocumentMapper();
    QueryAdapterBuilder queryAdapterBuilder;
    if (queryParamsBuilder != null) {
        queryAdapterBuilder = new QueryParamsAdapterBuilder(queryParamsBuilder, moduleRegistry);
    } else {
        queryAdapterBuilder = new QuerySpecAdapterBuilder(querySpecDeserializer, moduleRegistry);
    }
    return new HttpRequestProcessorImpl(moduleRegistry, controllerRegistry, exceptionMapperRegistry, queryAdapterBuilder);
}
Also used : ControllerRegistry(io.crnk.core.engine.internal.dispatcher.ControllerRegistry) QuerySpecAdapterBuilder(io.crnk.core.queryspec.internal.QuerySpecAdapterBuilder) QueryParamsAdapterBuilder(io.crnk.legacy.internal.QueryParamsAdapterBuilder) QueryAdapterBuilder(io.crnk.core.engine.query.QueryAdapterBuilder) HttpRequestProcessorImpl(io.crnk.core.engine.internal.http.HttpRequestProcessorImpl) ControllerRegistryBuilder(io.crnk.core.engine.internal.dispatcher.ControllerRegistryBuilder)

Example 3 with QueryAdapterBuilder

use of io.crnk.core.engine.query.QueryAdapterBuilder in project crnk-framework by crnk-project.

the class CrnkBootTest method setQuerySpecDeserializer.

@Test
public void setQuerySpecDeserializer() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceDiscoveryFactory(serviceDiscoveryFactory);
    boot.setDefaultServiceUrlProvider(mock(ServiceUrlProvider.class));
    QuerySpecDeserializer deserializer = Mockito.mock(QuerySpecDeserializer.class);
    boot.setQuerySpecDeserializer(deserializer);
    Assert.assertSame(deserializer, boot.getQuerySpecDeserializer());
    boot.boot();
    HttpRequestProcessorImpl requestDispatcher = boot.getRequestDispatcher();
    QueryAdapterBuilder queryAdapterBuilder = requestDispatcher.getQueryAdapterBuilder();
    Assert.assertTrue(queryAdapterBuilder instanceof QuerySpecAdapterBuilder);
}
Also used : QuerySpecAdapterBuilder(io.crnk.core.queryspec.internal.QuerySpecAdapterBuilder) QuerySpecDeserializer(io.crnk.core.queryspec.QuerySpecDeserializer) DefaultQuerySpecDeserializer(io.crnk.core.queryspec.DefaultQuerySpecDeserializer) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) ServiceUrlProvider(io.crnk.core.engine.url.ServiceUrlProvider) HttpRequestProcessorImpl(io.crnk.core.engine.internal.http.HttpRequestProcessorImpl) QueryAdapterBuilder(io.crnk.core.engine.query.QueryAdapterBuilder) Test(org.junit.Test)

Aggregations

HttpRequestProcessorImpl (io.crnk.core.engine.internal.http.HttpRequestProcessorImpl)3 QueryAdapterBuilder (io.crnk.core.engine.query.QueryAdapterBuilder)3 ConstantServiceUrlProvider (io.crnk.core.engine.url.ConstantServiceUrlProvider)2 ServiceUrlProvider (io.crnk.core.engine.url.ServiceUrlProvider)2 QuerySpecAdapterBuilder (io.crnk.core.queryspec.internal.QuerySpecAdapterBuilder)2 QueryParamsAdapterBuilder (io.crnk.legacy.internal.QueryParamsAdapterBuilder)2 Test (org.junit.Test)2 ControllerRegistry (io.crnk.core.engine.internal.dispatcher.ControllerRegistry)1 ControllerRegistryBuilder (io.crnk.core.engine.internal.dispatcher.ControllerRegistryBuilder)1 DefaultQuerySpecDeserializer (io.crnk.core.queryspec.DefaultQuerySpecDeserializer)1 QuerySpecDeserializer (io.crnk.core.queryspec.QuerySpecDeserializer)1 QueryParamsBuilder (io.crnk.legacy.queryParams.QueryParamsBuilder)1