use of org.apache.cayenne.di.spi.DefaultInjector in project cayenne by apache.
the class WebModuleTest method testBind_Scopes.
@Test
public void testBind_Scopes() {
Injector injector = new DefaultInjector(new WebModule());
RequestHandler handler = injector.getInstance(RequestHandler.class);
assertTrue(handler instanceof SessionContextRequestHandler);
RequestHandler handler1 = injector.getInstance(RequestHandler.class);
assertNotSame("Incorrect singleton scope for request handler", handler, handler1);
}
Aggregations