Search in sources :

Example 1 with QueryParamsAdapterBuilder

use of io.crnk.legacy.internal.QueryParamsAdapterBuilder 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 QueryParamsAdapterBuilder

use of io.crnk.legacy.internal.QueryParamsAdapterBuilder 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)

Aggregations

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