Skip to content

Commit

Permalink
List all available test options
Browse files Browse the repository at this point in the history
  • Loading branch information
sberyozkin committed Oct 10, 2023
1 parent fdfbad4 commit d91871b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ For information about supported authentication options, see the xref:security-oi
[[integration-testing]]
=== Testing

You can choose between <<integration-testing-wiremock>>,<<integration-testing-oidc-test-client>>, <<integration-testing-keycloak-devservices>>, <<integration-testing-keycloak>>, <<integration-testing-public-key>> and <<integration-testing-security-annotation>> test options to test Quarkus endpoints expecting bearer access tokens.

You can begin testing by adding the following dependencies to your test project:
====
[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
Expand Down Expand Up @@ -426,7 +428,7 @@ testImplementation("io.quarkus:quarkus-junit5")
//@sberyozkin - It might be good to add a stament here about the different mechanisms or methods to integration testing. For example, WireMock... etc


[[wiremock-integration-testing]]
[[integration-testing-wiremock]]
==== WireMock

You can also use link:https://wiremock.org/[WireMock] for integration testing.
Expand Down Expand Up @@ -566,7 +568,7 @@ For example, lets assume you have the following configuration:
%test.quarkus.oidc.credentials.secret=secret
----

Start with addding the same dependency as in the <<wiremock-integration-testing>> section, `quarkus-test-oidc-server`.
Start with addding the same dependency as in the <<integration-testing-wiremock>> section, `quarkus-test-oidc-server`.

Next, write the test code like this:

Expand Down Expand Up @@ -844,7 +846,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 <<wiremock-integration-testing>> 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 <<integration-testing-wiremock>> section.
You can use your own test keys, if preferred.

This approach provides limited coverage compared to the WireMock approach.
Expand Down

0 comments on commit d91871b

Please sign in to comment.