@Override protected DelegatingSecurityContextExecutor create() { return new DelegatingSecurityContextExecutor(getExecutor(), securityContext); } }
@Override protected DelegatingSecurityContextExecutor create() { return new DelegatingSecurityContextExecutor(getExecutor()); } }
@Test(expected = IllegalArgumentException.class) public void constructorNullDelegate() { new DelegatingSecurityContextExecutor(null); }
/** * @return the executor for UI background processes. */ @Bean(name = "uiExecutor") @ConditionalOnMissingBean(name = "uiExecutor") public Executor uiExecutor() { final BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<>(20); final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 20, 10000, TimeUnit.MILLISECONDS, blockingQueue, new ThreadFactoryBuilder().setNameFormat("ui-executor-pool-%d").build()); threadPoolExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return new DelegatingSecurityContextExecutor(threadPoolExecutor); }
/** * @return the executor for UI background processes. */ @Bean(name = "uiExecutor") @ConditionalOnMissingBean(name = "uiExecutor") public Executor uiExecutor() { final BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<>(20); final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 20, 10000, TimeUnit.MILLISECONDS, blockingQueue, new ThreadFactoryBuilder().setNameFormat("ui-executor-pool-%d").build()); threadPoolExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return new DelegatingSecurityContextExecutor(threadPoolExecutor); }
@Bean @ConditionalOnMissingBean(WebDriver.class) @ConditionalOnBean(MockMvcHtmlUnitDriverBuilder.class) public HtmlUnitDriver htmlUnitDriver(MockMvcHtmlUnitDriverBuilder builder) { HtmlUnitDriver driver = builder.build(); if (ClassUtils.isPresent(SECURITY_CONTEXT_EXECUTOR, getClass().getClassLoader())) { driver.setExecutor(new DelegatingSecurityContextExecutor( Executors.newSingleThreadExecutor())); } return driver; }