AsynchronousJobPool implements ContextResolver<AsynchronousJobPool> { public int getJobTimeout() { return jobTimeout; } AsynchronousJobPool(EverrestConfiguration config); String getAsynchronousServicePath(); int getMaxCacheSize(); int getMaxQueueSize(); int getThreadPoolSize(); int getJobTimeout(); @Override AsynchronousJobPool getContext(Class<?> type); final AsynchronousJob addJob(Object resource, ResourceMethodDescriptor resourceMethod, Object[] params); AsynchronousJob getJob(Long jobId); AsynchronousJob removeJob(Long jobId); List<AsynchronousJob> getAll(); boolean registerListener(AsynchronousJobListener listener); boolean unregisterListener(AsynchronousJobListener listener); @PreDestroy void stop();  }
@Test public void readsTimeoutFromConfiguration() throws Exception { final EverrestConfiguration configuration = new EverrestConfiguration(); configuration.setAsynchronousJobTimeout(777); asynchronousJobPool = new AsynchronousJobPool(configuration); assertEquals(777, asynchronousJobPool.getJobTimeout()); }