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);
}
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);
}
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);
}
Aggregations