Created
May 15, 2017 12:52
-
-
Save jklingsporn/329921215f49771efed1f8d4b51ee6e4 to your computer and use it in GitHub Desktop.
vertx-jooq release 2.2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void asyncCRUDConditionShouldSucceed() throws InterruptedException { | |
CountDownLatch latch = new CountDownLatch(1); | |
CompletableFuture<Integer> insertFuture = dao.insertReturningPrimaryAsync(createSomething()); | |
insertFuture. | |
thenCompose(v -> dao.fetchOneAsync(Tables.SOMETHING.SOMEID.eq(insertFuture.join()))). | |
thenAccept(Assert::assertNotNull). | |
thenCompose(v -> dao.deleteExecAsync(Tables.SOMETHING.SOMEID.eq(insertFuture.join()))). | |
whenComplete(failOrCountDown(latch)); | |
await(latch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment