-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TransactionalUniAsserter never fails with Hibernate Reactive #36599
Conversation
Thanks for your pull request! The title of your pull request does not follow our editorial rules. Could you have a look?
This message is automatically generated by a bot. |
a74217f
to
88d638b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
test-framework/vertx/src/main/java/io/quarkus/test/vertx/UniAsserter.java
Outdated
Show resolved
Hide resolved
Ugh, so an injected |
@DavideD pls sort the imports ;-) |
61a086c
to
f4429cc
Compare
This comment has been minimized.
This comment has been minimized.
9b70d5f
to
9cbaa30
Compare
This comment has been minimized.
This comment has been minimized.
Uff, there are some issues with the build. I will have another look on Thursday |
@Test | ||
@RunOnVertxContext | ||
public void testFailure(final TransactionalUniAsserter asserter) { | ||
assertThrows(AssertionFailedError.class, asserter::fail); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, asserter::fail
does not result in an exception. You would need to subscribe to the underlying Uni
.
Unfortunately, JUnit5 does support the Junit4-style @Test(expected = NullPointerException.class)
. So we can't easily assert the failure...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right. Thanks
TransactionalUniAsserterTestMethodInvoker is a subclass of RunOnVertxContextTestMethodInvoker. The problem is that there were two separate pointers keeping track of the asserter in the superclass and in the subclass. This lead to only one pointer being initialized and, if the wrong pointer was null-checked, the asserter was ignored causing the test to never fail. This commit fixes the issue by keeping only one reference to the asserter in the superclass.
Use method reference where possible
The goal is to extract the `asUni()` method from `UniAsserter`
I've removed the test for now. I need to focus on another issue. But, we need to add a way to test when something fails |
It's a pity that we don't have a test that the injected |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
Fix #36582