-
Notifications
You must be signed in to change notification settings - Fork 3k
QuarkusComponentTest: introduce QuarkusComponentTestCallbacks, integrate seamlessly with quarkus-panache-mock #50323
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
Conversation
- this service provider can be used to contribute additional logic to QuarkusComponentTestExtension
This comment has been minimized.
This comment has been minimized.
|
🙈 The PR is closed and the preview is expired. |
|
The ArC/component test code looks OK, but I don't know the Panache / Panache Mock code nearly well enough to be able to approve. |
Fair enough. In the if (!PanacheMock.IsMockEnabled)
throw new RuntimeException("Panache mock not enabled");
if (!PanacheMock.isMocked(TestClass.class))
throw new RuntimeException("FooEntity not mocked");
try {
return (int)PanacheMock.mockMethod(FooEntity.class, "foo", new Class<?>[] {int.class}, new Object[] {arg});
} catch (PanacheMock.InvokeRealMethodException e) {
throw new RuntimeException("Unstubbed method called", e);
} |
This comment has been minimized.
This comment has been minimized.
Ladicek
left a comment
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.
As mentioned yesterday, the ArC/Component Test part LGTM. I'm specifically not approving the Panache Mock part :-)
Of course! I was just trying to explain the principle and enlighten you ;-). |
FroMage
left a comment
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.
Also… I'm afraid you're missing the HR version 😬
...he-mock/src/main/java/io/quarkus/panache/mock/impl/PanacheQuarkusComponentTestCallbacks.java
Show resolved
Hide resolved
extensions/panache/panache-mock/src/main/java/io/quarkus/panache/mock/MockPanacheEntities.java
Show resolved
Hide resolved
...he-mock/src/main/java/io/quarkus/panache/mock/impl/PanacheQuarkusComponentTestCallbacks.java
Show resolved
Hide resolved
...he-mock/src/main/java/io/quarkus/panache/mock/impl/PanacheQuarkusComponentTestCallbacks.java
Show resolved
Hide resolved
...src/main/resources/META-INF/services/io.quarkus.test.component.QuarkusComponentTestCallbacks
Outdated
Show resolved
Hide resolved
Yes, that's intentional. We don't support Mongo stuff etc. as well. I have a NOTE in the docs locally. |
e3a1f38 to
ef47508
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Status for workflow
|
Status for workflow
|
This is a follow-up to #50164.
We introduce the
QuarkusComponentTestCallbacksservice provider that can be used to contribute additional logic toQuarkusComponentTestExtension(I choose the name "callbacks" to keep consistency with quarkus-junit5).In the second commit we add a few bytecode transformations in order to support
quarkus-panache-mockfunctionality in a QuarkusComponentTest.