Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/main/java/io/vertx/junit5/VertxTestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,24 +183,6 @@ public synchronized Checkpoint checkpoint(int requiredNumberOfPasses) {

// ........................................................................................... //

/**
* Create an asynchronous result handler that expects a success.
*
* @param <T> the asynchronous result type.
* @return the handler.
* @deprecated Use {@link #succeedingThenComplete()} or {@link #succeeding(Handler)}, for example
* <code>succeeding(value -> checkpoint.flag())</code>, <code>succeeding(value -> { more testing code })</code>, or
* <code>succeeding(value -> {})</code>.
*/
@Deprecated
public <T> Handler<AsyncResult<T>> succeeding() {
return ar -> {
if (!ar.succeeded()) {
failNow(ar.cause());
}
};
}

/**
* Create an asynchronous result handler that expects a success, and passes the value to another handler.
*
Expand Down
17 changes: 0 additions & 17 deletions src/test/java/io/vertx/junit5/tests/VertxTestContextTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@ void fail_with_null() {
.hasMessage("The exception cannot be null");
}

@Test
@DisplayName("Check the behavior of succeeding() and that it does not complete the test context")
void check_async_assert() throws InterruptedException {
VertxTestContext context = new VertxTestContext();
context.succeeding().handle(Future.succeededFuture());
assertThat(context.awaitCompletion(1, TimeUnit.MILLISECONDS)).isFalse();
assertThat(context.completed()).isFalse();

context = new VertxTestContext();
context.succeeding().handle(Future.failedFuture(new RuntimeException("Plop")));
assertThat(context.awaitCompletion(1, TimeUnit.MILLISECONDS)).isTrue();
assertThat(context.failed()).isTrue();
assertThat(context.causeOfFailure())
.isInstanceOf(RuntimeException.class)
.hasMessage("Plop");
}

@Test
@DisplayName("Check the behavior of failing()")
void check_async_assert_fail() throws InterruptedException {
Expand Down