use of io.crnk.monitor.brave.internal.BraveRepositoryFilter in project crnk-framework by crnk-project.
the class BraveModule method setupModule.
@Override
public void setupModule(ModuleContext context) {
// nothing to do
if (server) {
BraveRepositoryFilter filter = new BraveRepositoryFilter(brave, context);
context.addRepositoryFilter(filter);
}
}
use of io.crnk.monitor.brave.internal.BraveRepositoryFilter in project crnk-framework by crnk-project.
the class BraveResponseFilterTest method setup.
@Before
public void setup() {
boot = new CrnkBoot();
boot.setServiceDiscovery(new ReflectionsServiceDiscovery("io.crnk.test.mock.repository", new SampleJsonServiceLocator()));
boot.boot();
span = Mockito.mock(Span.class);
tracing = Mockito.mock(Tracing.class);
tracer = Mockito.mock(Tracer.class);
Mockito.when(tracing.tracer()).thenReturn(tracer);
Mockito.when(tracer.nextSpan()).thenReturn(span);
moduleContext = Mockito.mock(Module.ModuleContext.class);
Mockito.when(moduleContext.getResourceRegistry()).thenReturn(boot.getResourceRegistry());
QuerySpec querySpec = new QuerySpec(Task.class);
queryAdapter = new QuerySpecAdapter(querySpec, boot.getResourceRegistry());
ResourceInformation taskResourceInformation = boot.getResourceRegistry().getEntry(Task.class).getResourceInformation();
requestSpec = Mockito.mock(RepositoryRequestSpec.class);
Mockito.when(requestSpec.getMethod()).thenReturn(HttpMethod.GET);
Mockito.when(requestSpec.getQueryAdapter()).thenReturn(queryAdapter);
Mockito.when(requestSpec.getQuerySpec(taskResourceInformation)).thenReturn(querySpec);
filter = new BraveRepositoryFilter(tracing, moduleContext);
filterContext = Mockito.mock(RepositoryFilterContext.class);
Mockito.when(filterContext.getRequest()).thenReturn(requestSpec);
filterChain = Mockito.mock(RepositoryRequestFilterChain.class);
}
use of io.crnk.monitor.brave.internal.BraveRepositoryFilter in project crnk-framework by crnk-project.
the class BraveServerModule method setupModule.
@Override
public void setupModule(ModuleContext context) {
BraveRepositoryFilter filter = new BraveRepositoryFilter(tracing, context);
context.addRepositoryFilter(filter);
}
Aggregations