-
Notifications
You must be signed in to change notification settings - Fork 3k
Document mocking an authorization server with Mockito #10396
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
Document mocking an authorization server with Mockito #10396
Conversation
|
|
||
| [source,java] | ||
| ---- | ||
| private static WireMockServer wireMockServer = new WireMockServer(); |
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.
I am pretty sure that we want to do something like
| public class WiremockCountries implements QuarkusTestResourceLifecycleManager { // <2> |
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.
Bot approache are good for different reason.
If we prefere TestResource I'm OK to switch to it inside our integration test and update the guide.
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.
Not really, when you use %test.quarkus.oauth2.introspection-url=http://localhost:8080/introspect it applies to all tests, so best make sure that you have a Wiremock server up for all tests
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.
This is a good point indead ;)
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.
:)
a3cca08 to
6956c3c
Compare
|
@geoand I switch to using a test resource instead of starting Wiremock directly inside the test. I must admit it is way elegant (I love the fact you can override runtime properties, learn a new trick ;) ). I'll open a quickstart PR to include this inside the quickstart with a test. |
|
Excellent, thanks a lot @loicmathieu! I'll take a quick look later on, but I'll let @sberyozkin have the final say. |
|
And the PR that update the quickstart is here: quarkusio/quarkus-quickstarts#609 |
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.
LGTM
6956c3c to
3765f3b
Compare
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.
This is just super cool, thanks @geoand for doing the real review :-)
@loicmathieu - thanks
|
I'll follow Loic's lead and do something similar for the quarkus-oidc |
|
@loicmathieu you can now merge this on your own, right? |
Yes, this will be the first time I hit the |
|
Please when doing substantial doc changes, run the doc build before creating the PR. This one broke the build. Thanks! |
|
Fixed in #10413 |
|
Thanks @gsmet! |
|
Sorry for this @gsmet, I only run doc build in case of new doc, or when adding links to check them. Maybe we can add a doc CI workflow, it should be easy to create one and avoid such issue. |
Fixes #10364
I'll open a PR on the quickstart to add this later.