30 |
|
|
31 |
|
public void testToString() { |
32 |
|
CompletableFuture<String> f; |
33 |
< |
assertTrue(new CompletableFuture<String>().toString() |
34 |
< |
.contains("[Not completed]")); |
33 |
> |
|
34 |
|
f = new CompletableFuture<String>(); |
35 |
+ |
assertTrue(f.toString().contains("[Not completed]")); |
36 |
+ |
|
37 |
|
f.complete("foo"); |
38 |
|
assertTrue(f.toString().contains("[Completed normally]")); |
39 |
+ |
|
40 |
|
f = new CompletableFuture<String>(); |
41 |
|
f.completeExceptionally(new IndexOutOfBoundsException()); |
42 |
|
assertTrue(f.toString().contains("[Completed exceptionally]")); |