@Test
public void testExecuteJob07() throws Exception {

    final RuntimeException runtimeException = new RuntimeException(
            "exception in AsyncJobWorker#executeWorker()");
    doReturn(true).when(asyncJobWorker).beforeExecute(anyString());
    doThrow(runtimeException).when(asyncJobWorker)
            .executeWorker("0000000001");
    Semaphore semaphore = new Semaphore(10);
    doAnswer(new Answer<Object>() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            Runnable runnable = invocation.getArgumentAt(0, Runnable.class);
            runnable.run();
            return null;
        }
    }).when(threadPoolTaskExecutor).execute(any(Runnable.class));
    AsyncJobLauncherImpl asyncJobLauncher = new AsyncJobLauncherImpl(
            threadPoolTaskExecutor, asyncJobWorker);
    asyncJobLauncher.taskPoolLimit = semaphore;
    // テスト実行
    asyncJobLauncher.executeJob("0000000001");
    // セマフォのサイズが元に戻っていること
    assertEquals(10, asyncJobLauncher.taskPoolLimit.availablePermits());
    // ThreadPoolTaskExecutor#execute()が呼び出されていること。
    verify(threadPoolTaskExecutor).execute(any(Runnable.class));
}