use of com.hazelcast.test.starter.constructor.DelegatingCompletableFutureConstructor in project hazelcast by hazelcast.
the class DelegatingCompletableFutureConstructorTest method test.
@Test
public void test() {
CompletableFuture<Integer> delegate = new CompletableFuture<>();
DelegatingCompletableFuture delegatingCompletableFuture = new DelegatingCompletableFuture(new DefaultSerializationServiceBuilder().build(), delegate);
DelegatingCompletableFutureConstructor constructor = new DelegatingCompletableFutureConstructor(delegatingCompletableFuture.getClass());
DelegatingCompletableFuture<Integer> cloned = (DelegatingCompletableFuture<Integer>) constructor.createNew(delegatingCompletableFuture);
delegate.complete(42);
assertTrue(cloned.isDone());
assertEquals(42, cloned.join().intValue());
}
Aggregations