Merge pull request #506 from dzmitryh/master

Cosmetic fixes in async-method-invocation
This commit is contained in:
Ilkka Seppälä 2016-10-28 19:13:17 +03:00 committed by GitHub
commit 932700d9b1
2 changed files with 2 additions and 5 deletions

View File

@ -57,12 +57,10 @@ public class ThreadAsyncExecutor implements AsyncExecutor {
@Override
public <T> T endProcess(AsyncResult<T> asyncResult) throws ExecutionException, InterruptedException {
if (asyncResult.isCompleted()) {
return asyncResult.getValue();
} else {
if (!asyncResult.isCompleted()) {
asyncResult.await();
return asyncResult.getValue();
}
return asyncResult.getValue();
}
/**

View File

@ -31,7 +31,6 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import static org.junit.Assert.*;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.*;
import static org.mockito.internal.verification.VerificationModeFactory.times;