eclipse-vertx / eclipse-vertx/vertx-junit5
A single checkpoint should not supersede a succeedingThenComplete
- Dominant language
- Java
- Stars
- 43
- Forks
- 33
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
#### Describe the feature
Given code like this:
```java
@Test
void testProc(VertxTestContext testContext) {
var checkpoint = testContext.checkpoint();
returnsFuture()
.onSuccess(v -> checkpoint.flag())
.compose(v -> anotherReturnsFuture())
.onComplete(testContext.succeedingThenComplete());
}
```
the user's intent is almost always to flag the checkpoint but to keep running until `testContext.succeedingThenComplete()` is called with a succeeded future.
Currently, creating a checkpoint like in the above statement will actually end the test as soon as the test thread notices `checkpoint.flag()` (i.e. the injected `testContext.awaitCompletion` will be satisfied). This is very clunky.
#### Use cases
A common use case is to run some side-by-side check independent the test code and use checkpoints to flag that your assertions were actually run. For example you might mock a class and `checkpoint.flag()` inside a mocked method that runs assertions on its arguments.
#### Contribution
I can implement this feature.
Contributor guide
Assessment
This issue has not been assessed yet.