Incorrect assumptions in LazyAndFutureSourcesTest (#28479)

This commit is contained in:
Johan Andrén 2020-01-14 13:53:05 +01:00 committed by GitHub
parent 4c9c05cfde
commit 044e706eb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,6 @@
package akka.stream.javadsl;
import akka.Done;
import akka.NotUsed;
import akka.japi.Pair;
import akka.stream.StreamTest;
@ -60,7 +59,9 @@ public class LazyAndFutureSourcesTest extends StreamTest {
CompletionStage<NotUsed> nestedMatVal = result.first();
CompletionStage<List<String>> list = result.second();
assertEquals(Arrays.asList("one"), list.toCompletableFuture().get(3, TimeUnit.SECONDS));
assertEquals(true, nestedMatVal.toCompletableFuture().isDone());
// Future adaption to completionstage of matval means we cannot count on matval future being
// completed just because stream is
nestedMatVal.toCompletableFuture().get(3, TimeUnit.SECONDS);
}
@Test
@ -87,7 +88,9 @@ public class LazyAndFutureSourcesTest extends StreamTest {
CompletionStage<NotUsed> nestedMatVal = result.first();
CompletionStage<List<String>> list = result.second();
assertEquals(Arrays.asList("one"), list.toCompletableFuture().get(3, TimeUnit.SECONDS));
assertEquals(true, nestedMatVal.toCompletableFuture().isDone());
// Future adaption to completionstage of matval means we cannot count on matval future being
// completed just because stream is
nestedMatVal.toCompletableFuture().get(3, TimeUnit.SECONDS);
}
@Test
@ -101,6 +104,8 @@ public class LazyAndFutureSourcesTest extends StreamTest {
CompletionStage<NotUsed> nestedMatVal = result.first();
CompletionStage<List<String>> list = result.second();
assertEquals(Arrays.asList("one"), list.toCompletableFuture().get(3, TimeUnit.SECONDS));
assertEquals(true, nestedMatVal.toCompletableFuture().isDone());
// flatMap/thenCompose of matval means we cannot count on matval future being completed just
// because stream is
nestedMatVal.toCompletableFuture().get(3, TimeUnit.SECONDS);
}
}