/** * Tests whether the executor service is correctly passed to the super * class. */ @Test public void testInitExecutor() throws InterruptedException { final ExecutorService exec = Executors.newSingleThreadExecutor(); final CallableBackgroundInitializer<Integer> init = new CallableBackgroundInitializer<>( new TestCallable(), exec); assertEquals("Executor not set", exec, init.getExternalExecutor()); exec.shutdown(); exec.awaitTermination(1, TimeUnit.SECONDS); }