Skip to content

Commit 8cba9fb

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.
1 parent 4f06fc6 commit 8cba9fb

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
@@ -309,7 +309,7 @@ then Spring Security's test support can come in handy.
309309
Testing the method above with `WebTestClient` would require simulating some kind of grant flow with an authorization server.
310310
Certainly this would be a daunting task, which is why Spring Security ships with support for removing this boilerplate.
311311

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

314314
====
315315
.Java
@@ -544,7 +544,7 @@ fun foo(@AuthenticationPrincipal oauth2User: OAuth2User): Mono<String> {
544544
----
545545
====
546546

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

549549
====
550550
.Java
@@ -769,7 +769,7 @@ fun foo(@RegisteredOAuth2AuthorizedClient("my-app") authorizedClient: OAuth2Auth
769769
====
770770

771771
Simulating this handshake with the authorization server could be cumbersome.
772-
Instead, you can use `SecurityMockServerConfigurers#oauth2Client` to add a `OAuth2AuthorizedClient` into a mock `ServerOAuth2AuthorizedClientRepository`:
772+
Instead, you can use `SecurityMockServerConfigurers#mockOAuth2Client` to add a `OAuth2AuthorizedClient` into a mock `ServerOAuth2AuthorizedClientRepository`:
773773

774774
====
775775
.Java
@@ -973,7 +973,7 @@ We'll look at two of them now:
973973
==== `mockJwt() WebTestClientConfigurer`
974974

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

978978
====
979979
.Java
@@ -1211,7 +1211,7 @@ fun foo(authentication: BearerTokenAuthentication): Mono<String?> {
12111211
----
12121212
====
12131213

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

12161216
====
12171217
.Java

0 commit comments

Comments
 (0)