}
@Test(timeout = 5000)
public void shouldCallSuccessAfterAuthFailed() throws Exception {
when(task.execute())
.thenThrow(new AuthorizationException())
.thenReturn(Boolean.TRUE);
TaskExecutor.execute(repository, task);
task.waitForDestruction();
verify(task).success(Boolean.TRUE);
}