diff --git a/src/test/java/org/gcube/common/clients/AsyncDelegateTest.java b/src/test/java/org/gcube/common/clients/AsyncDelegateTest.java index ad0893a..2995be5 100644 --- a/src/test/java/org/gcube/common/clients/AsyncDelegateTest.java +++ b/src/test/java/org/gcube/common/clients/AsyncDelegateTest.java @@ -172,13 +172,10 @@ public class AsyncDelegateTest { @Test public void callbacksGetResults() throws Exception { - final CountDownLatch latch = new CountDownLatch(1); - //stage call Answer answer = new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { - latch.countDown(); return value; } }; @@ -190,8 +187,8 @@ public class AsyncDelegateTest { Future future = delegate.makeAsync(call,callback); - //make sure we test after call has been delivered - latch.await(5, SECONDS); + //make sure the callback has had time to arrive + Thread.sleep(400); verify(callback).done(value);