Skip to content

Commit 008e7d5

Browse files
committed
[#487] Add utility test methods to BaseReactiveTest
Additional test methods for when we need create an async before calling the method.
1 parent fc875d2 commit 008e7d5

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/BaseReactiveTest.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,13 @@ public abstract class BaseReactiveTest {
8282
private ReactiveConnection connection;
8383

8484
protected static void test(TestContext context, CompletionStage<?> work) {
85-
// this will be added to TestContext in the next vert.x release
86-
Async async = context.async();
85+
test( context.async(), context, work );
86+
}
87+
88+
/**
89+
* For when we need to create the {@link Async} in advance
90+
*/
91+
protected static void test(Async async, TestContext context, CompletionStage<?> work) {
8792
work.whenComplete( (res, err) -> {
8893
if ( res instanceof Stage.Session ) {
8994
Stage.Session s = (Stage.Session) res;
@@ -101,7 +106,13 @@ protected static void test(TestContext context, CompletionStage<?> work) {
101106
}
102107

103108
protected static void test(TestContext context, Uni<?> uni) {
104-
Async async = context.async();
109+
test( context.async(), context, uni );
110+
}
111+
112+
/**
113+
* For when we need to create the {@link Async} in advance
114+
*/
115+
protected static void test(Async async, TestContext context, Uni<?> uni) {
105116
uni.subscribe().with(
106117
res -> {
107118
if ( res instanceof Mutiny.Session) {

0 commit comments

Comments
 (0)