From 22df2050d5ecd2cb279d66fe2631f9e41c846f6a Mon Sep 17 00:00:00 2001 From: Rolfe Dlugy-Hegwer Date: Thu, 18 Jul 2024 10:57:34 -0400 Subject: [PATCH] Remove :no-deprecated-test-resource[] conditionalization from Wiremock and OidcTestClient content --- docs/src/main/asciidoc/security-oidc-auth0-tutorial.adoc | 2 -- .../asciidoc/security-oidc-bearer-token-authentication.adoc | 6 +++--- .../asciidoc/security-oidc-code-flow-authentication.adoc | 6 ++---- .../asciidoc/security-openid-connect-client-reference.adoc | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/src/main/asciidoc/security-oidc-auth0-tutorial.adoc b/docs/src/main/asciidoc/security-oidc-auth0-tutorial.adoc index 6ee2b51a4e7cd9..7c52d1b14c2813 100644 --- a/docs/src/main/asciidoc/security-oidc-auth0-tutorial.adoc +++ b/docs/src/main/asciidoc/security-oidc-auth0-tutorial.adoc @@ -887,7 +887,6 @@ Open a browser, access http://localhost:8080/hello and get the name displayed in To confirm the permission is correctly enforced, change it to `echo.name`: `@PermissionsAllowed("echo.name")`. Clear the browser cache, access http://localhost:8080/hello again and you will get `403` reported by `ApiEchoService`. Now revert it back to `@PermissionsAllowed("echo:name")`. -ifndef::no-deprecated-test-resource[] == Integration testing You have already used OIDC DevUI SPA to login to Auth0 and test the Quarkus endpoint with the access token, updating the endpoint code along the way. @@ -1036,7 +1035,6 @@ image::auth0-test-success.png[Auth0 test success] By the way, if you like, you can run the tests in Continuous mode directly from DevUI: image::auth0-continuous-testing.png[Auth0 Continuous testing] -endif::no-deprecated-test-resource[] [[production-mode]] == Production mode diff --git a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc index 4907c4fddaff3b..cc7bf1ab940169 100644 --- a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc +++ b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc @@ -469,7 +469,7 @@ testImplementation("io.rest-assured:rest-assured") testImplementation("io.quarkus:quarkus-junit5") ---- -[[integration-testing-wiremock]] +[[bearer-token-integration-testing-wiremock]] ==== WireMock Add the following dependencies to your test project: @@ -604,7 +604,7 @@ For example, you have the following configuration: %test.quarkus.oidc.credentials.secret=secret ---- -To start, add the same dependency, `quarkus-test-oidc-server`, as described in the <> section. +To start, add the same dependency, `quarkus-test-oidc-server`, as described in the <> section. Next, write the test code as follows: @@ -868,7 +868,7 @@ quarkus.oidc.public-key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlivFI8qB4D0y smallrye.jwt.sign.key.location=/privateKey.pem ---- -To generate JWT tokens, copy `privateKey.pem` from the `integration-tests/oidc-tenancy` in the `main` Quarkus repository and use a test code similar to the one in the preceding <> section. +To generate JWT tokens, copy `privateKey.pem` from the `integration-tests/oidc-tenancy` in the `main` Quarkus repository and use a test code similar to the one in the preceding <> section. You can use your own test keys, if preferred. This approach provides limited coverage compared to the WireMock approach. diff --git a/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc b/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc index 40f43774f43cf0..9183cec364b0f8 100644 --- a/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc +++ b/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc @@ -1522,8 +1522,7 @@ testImplementation("net.sourceforge.htmlunit:htmlunit") testImplementation("io.quarkus:quarkus-junit5") ---- -ifndef::no-deprecated-test-resource[] -[[integration-testing-wiremock]] +[[code-flow-integration-testing-wiremock]] === Wiremock Add the following dependency: @@ -1609,7 +1608,6 @@ The user `admin` has the `user` and `admin` roles by default - it can be customi Additionally, `OidcWiremockTestResource` sets the token issuer and audience to `https://service.example.com`, which can be customized with `quarkus.test.oidc.token.issuer` and `quarkus.test.oidc.token.audience` system properties. `OidcWiremockTestResource` can be used to emulate all OIDC providers. -endif::no-deprecated-test-resource[] [[integration-testing-keycloak-devservices]] === Dev Services for Keycloak @@ -1636,7 +1634,7 @@ If a custom realm file has to be imported into Keycloak before running the tests quarkus.keycloak.devservices.realm-path=quarkus-realm.json ---- -Finally, write a test code the same way as it is described in the <> section. +Finally, write a test code the same way as it is described in the <> section. The only difference is that `@QuarkusTestResource` is no longer needed: [source, java] diff --git a/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc b/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc index 1f640b1e1179ed..b2d3673ec801ed 100644 --- a/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc +++ b/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc @@ -765,7 +765,7 @@ Start by adding the following dependencies to your test project: ---- -[[integration-testing-wiremock]] +[[oidc-client-ref-integration-testing-wiremock]] ==== Wiremock Add the following dependencies to your test project: