use of io.crnk.core.engine.filter.DocumentFilterChain in project crnk-framework by crnk-project.
the class MetaModule method setupModule.
@Override
public void setupModule(ModuleContext context) {
this.context = context;
informationBuilder = registerInformationBuilder(context.getPropertiesProvider());
if (context.isServer()) {
context.addFilter(new DocumentFilter() {
@Override
public Response filter(DocumentFilterContext filterRequestContext, DocumentFilterChain chain) {
try {
return chain.doFilter(filterRequestContext);
} finally {
lookupRequestLocal.remove();
}
}
});
} else {
context.addResourceLookup(new ResourceLookup() {
@SuppressWarnings("unchecked")
@Override
public Set<Class<?>> getResourceClasses() {
return (Set) collectMetaClasses();
}
});
}
}
use of io.crnk.core.engine.filter.DocumentFilterChain in project crnk-framework by crnk-project.
the class JsonApiActionResponseTest method setupFeature.
@Override
protected void setupFeature(CrnkTestFeature feature) {
filter = Mockito.spy(new DocumentFilter() {
@Override
public Response filter(DocumentFilterContext filterRequestContext, DocumentFilterChain chain) {
return chain.doFilter(filterRequestContext);
}
});
SimpleModule testModule = new SimpleModule("testFilter");
testModule.addFilter(filter);
feature.addModule(testModule);
}
use of io.crnk.core.engine.filter.DocumentFilterChain in project crnk-framework by crnk-project.
the class BasicActionTest method setupFeature.
@Override
protected void setupFeature(CrnkTestFeature feature) {
filter = Mockito.spy(new DocumentFilter() {
@Override
public Response filter(DocumentFilterContext filterRequestContext, DocumentFilterChain chain) {
return chain.doFilter(filterRequestContext);
}
});
SimpleModule testModule = new SimpleModule("testFilter");
testModule.addFilter(filter);
feature.addModule(testModule);
}
Aggregations