This is an automated email from the ASF dual-hosted git repository.
toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git
The following commit(s) were added to refs/heads/master by this push:
new 61b6f0e Test thenAccept
new f798684 Merge pull request #103 from atoulme/test_asyncresult_accept
61b6f0e is described below
commit 61b6f0e3a48f005424fa0e3f93042dee2c9a520d
Author: Antoine Toulme <[email protected]>
AuthorDate: Sat Jun 27 13:21:40 2020 -0700
Test thenAccept
---
.../tuweni/concurrent/DefaultCompletableAsyncResultTest.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git
a/concurrent/src/test/java/org/apache/tuweni/concurrent/DefaultCompletableAsyncResultTest.java
b/concurrent/src/test/java/org/apache/tuweni/concurrent/DefaultCompletableAsyncResultTest.java
index 9680b8f..5d8b135 100644
---
a/concurrent/src/test/java/org/apache/tuweni/concurrent/DefaultCompletableAsyncResultTest.java
+++
b/concurrent/src/test/java/org/apache/tuweni/concurrent/DefaultCompletableAsyncResultTest.java
@@ -42,6 +42,15 @@ class DefaultCompletableAsyncResultTest {
}
@Test
+ void shouldThenAccept() {
+ AtomicReference<String> result = new AtomicReference<String>();
+ CompletableAsyncResult<String> asyncResult = AsyncResult.incomplete();
+ asyncResult.thenAccept(result::set);
+ asyncResult.complete("foo");
+ assertThat(result.get()).isEqualTo("foo");
+ }
+
+ @Test
void shouldReturnExceptionFromExceptionallyCompletedResult() throws
Exception {
Exception exception = new RuntimeException();
AsyncResult<String> asyncResult = AsyncResult.exceptional(exception);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]