merged from trunk
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/common/common-clients/2.0@74513 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
48e934b2c5
commit
e58ebe247e
|
@ -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<Object>() {
|
||||
@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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue