@Test public void testExecutorService() throws TimeoutException, InterruptedException { Security security = Security.builder().build(); AtomicReference<Class> execClassHolder = new AtomicReference<>(); Routing routing = Routing.builder() .register(WebSecurity.create(security)) .get("/unit_test", (req, res) -> { req.context() .get(SecurityContext.class) .ifPresent(context -> execClassHolder.set(context.executorService().getClass())); req.next(); }) .build(); TestClient.create(routing).path("/unit_test").get(); Class execClass = execClassHolder.get(); assertThat(execClass, notNullValue()); assertThat(execClass, is(not(ForkJoinPool.class))); }
public static WebSecurity create(Security security) { return new WebSecurity(security, null); }
WebSecurity implements Service { public static WebSecurity create(Security security) { return new WebSecurity(security, null); } }
WebSecurity implements Service { public static WebSecurity create(Security security) { return new WebSecurity(security, null); } private  WebSecurity(Security security, Config config); private  WebSecurity(Security security, Config config, SecurityHandler defaultHandler); }
WebSecurity implements Service { public static WebSecurity create(Security security) { return new WebSecurity(security, null); } private  WebSecurity(Security security, Config config); private  WebSecurity(Security security, Config config, SecurityHandler defaultHandler); static WebSecurity create(Security security); static WebSecurity create(Config config); static WebSecurity create(Security security, Config config); static SecurityHandler secure(); static SecurityHandler authenticate(); static SecurityHandler audit(); static SecurityHandler authenticator(String explicitAuthenticator); static SecurityHandler authorizer(String explicitAuthorizer); static SecurityHandler rolesAllowed(String... roles); static SecurityHandler allowAnonymous(); static SecurityHandler authorize(); static SecurityHandler enforce(); WebSecurity securityDefaults(SecurityHandler defaultHandler); @Override void update(Routing.Rules routing); }
WebSecurity implements Service { public static WebSecurity create(Security security) { return new WebSecurity(security, null); } private  WebSecurity(Security security, Config config); private  WebSecurity(Security security, Config config, SecurityHandler defaultHandler); static WebSecurity create(Security security); static WebSecurity create(Config config); static WebSecurity create(Security security, Config config); static SecurityHandler secure(); static SecurityHandler authenticate(); static SecurityHandler audit(); static SecurityHandler authenticator(String explicitAuthenticator); static SecurityHandler authorizer(String explicitAuthorizer); static SecurityHandler rolesAllowed(String... roles); static SecurityHandler allowAnonymous(); static SecurityHandler authorize(); static SecurityHandler enforce(); WebSecurity securityDefaults(SecurityHandler defaultHandler); @Override void update(Routing.Rules routing); static final String CONTEXT_ADD_HEADERS; }