Skip to content

Commit fc1343f

Browse files
committed
fix
1 parent 9732c5e commit fc1343f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import org.junit.Test;
1616

17-
import io.smallrye.mutiny.Uni;
1817
import io.vertx.core.Context;
1918
import io.vertx.core.Vertx;
2019
import io.vertx.ext.unit.Async;
@@ -89,9 +88,8 @@ public void testOnPersistWithMutiny(TestContext testContext) throws Exception {
8988
newContext.runOnContext( event -> test( async, testContext, session
9089
.persist( new Competition( "Cheese Rolling" ) )
9190
.call( session::flush )
92-
.onItem().invoke( v -> testContext.fail( "We were expecting an exception" ) )
93-
.onFailure().recoverWithUni( e -> Uni.createFrom().voidItem()
94-
.invoke( () -> assertExceptionThrown( e ) ) ) )
91+
.onItem().failWith( () -> new AssertionError( "No exception thrown" ) )
92+
.onFailure().recoverWithItem( e -> assertExceptionThrown( e ) ) )
9593
);
9694
}
9795

@@ -108,9 +106,8 @@ public void testFindWithMutiny(TestContext testContext) throws Exception {
108106
// Run test in the new context
109107
newContext.runOnContext( event -> test( async, testContext, session
110108
.find( Competition.class, "Chess boxing" )
111-
.onItem().invoke( v -> testContext.fail( "We were expecting an exception" ) )
112-
.onFailure().recoverWithUni( e -> Uni.createFrom().voidItem()
113-
.replaceWith( () -> assertExceptionThrown( e ) ) ) )
109+
.onItem().failWith( () -> new AssertionError( "No exception thrown" ) )
110+
.onFailure().recoverWithItem( e -> assertExceptionThrown( e ) ) )
114111
);
115112
}
116113

0 commit comments

Comments
 (0)