Skip to content

Commit 1ca04ff

Browse files
miller79marcusdacoregio
authored andcommitted
Updated test.adoc SecurityMockServerConfigurers method references
Updated all references to SecurityMockServerConfigurers to refer to correct methods. Added documentation for mockJwt to include the SecurityMockServerConfigurers class. Issue gh-10254
1 parent 2bdaa31 commit 1ca04ff

File tree

1 file changed

+5
-5
lines changed
  • docs/manual/src/docs/asciidoc/_includes/reactive

1 file changed

+5
-5
lines changed

docs/manual/src/docs/asciidoc/_includes/reactive/test.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ then Spring Security's test support can come in handy.
184184
Testing the method above with `WebTestClient` would require simulating some kind of grant flow with an authorization server.
185185
Certainly this would be a daunting task, which is why Spring Security ships with support for removing this boilerplate.
186186

187-
For example, we can tell Spring Security to include a default `OidcUser` using the `SecurityMockServerConfigurers#oidcLogin` method, like so:
187+
For example, we can tell Spring Security to include a default `OidcUser` using the `SecurityMockServerConfigurers#mockOidcLogin` method, like so:
188188

189189
[source,java]
190190
----
@@ -311,7 +311,7 @@ public Mono<String> foo(@AuthenticationPrincipal OAuth2User oauth2User) {
311311
}
312312
----
313313

314-
In that case, we can tell Spring Security to include a default `OAuth2User` using the `SecurityMockServerConfigurers#oauth2User` method, like so:
314+
In that case, we can tell Spring Security to include a default `OAuth2User` using the `SecurityMockServerConfigurers#mockOAuth2Login` method, like so:
315315

316316
[source,java]
317317
----
@@ -431,7 +431,7 @@ public Mono<String> foo(@RegisteredOAuth2AuthorizedClient("my-app") OAuth2Author
431431
----
432432

433433
Simulating this handshake with the authorization server could be cumbersome.
434-
Instead, you can use `SecurityMockServerConfigurers#oauth2Client` to add a `OAuth2AuthorizedClient` into an `WebSessionOAuth2ServerAuthorizedClientRepository`:
434+
Instead, you can use `SecurityMockServerConfigurers#mockOAuth2Client` to add a `OAuth2AuthorizedClient` into a mock `ServerOAuth2AuthorizedClientRepository`:
435435

436436
[source,java]
437437
----
@@ -555,7 +555,7 @@ We'll look at two of them now:
555555
==== `mockJwt() WebTestClientConfigurer`
556556

557557
The first way is via a `WebTestClientConfigurer`.
558-
The simplest of these would look something like this:
558+
The simplest of these would be to use the `SecurityMockServerConfigurers#mockJwt` method like the following:
559559

560560
[source,java]
561561
----
@@ -678,7 +678,7 @@ public Mono<String> foo(BearerTokenAuthentication authentication) {
678678
}
679679
----
680680

681-
In that case, we can tell Spring Security to include a default `BearerTokenAuthentication` using the `SecurityMockServerConfigurers#opaqueToken` method, like so:
681+
In that case, we can tell Spring Security to include a default `BearerTokenAuthentication` using the `SecurityMockServerConfigurers#mockOpaqueToken` method, like so:
682682

683683
[source,java]
684684
----

0 commit comments

Comments
 (0)