You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated all references to SecurityMockServerConfigurers to refer to
correct methods.
Added documentation for mockJwt to include the
SecurityMockServerConfigurers class.
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/reactive/test.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -309,7 +309,7 @@ then Spring Security's test support can come in handy.
309
309
Testing the method above with `WebTestClient` would require simulating some kind of grant flow with an authorization server.
310
310
Certainly this would be a daunting task, which is why Spring Security ships with support for removing this boilerplate.
311
311
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:
313
313
314
314
====
315
315
.Java
@@ -544,7 +544,7 @@ fun foo(@AuthenticationPrincipal oauth2User: OAuth2User): Mono<String> {
544
544
----
545
545
====
546
546
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:
548
548
549
549
====
550
550
.Java
@@ -769,7 +769,7 @@ fun foo(@RegisteredOAuth2AuthorizedClient("my-app") authorizedClient: OAuth2Auth
769
769
====
770
770
771
771
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`:
773
773
774
774
====
775
775
.Java
@@ -973,7 +973,7 @@ We'll look at two of them now:
973
973
==== `mockJwt() WebTestClientConfigurer`
974
974
975
975
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:
977
977
978
978
====
979
979
.Java
@@ -1211,7 +1211,7 @@ fun foo(authentication: BearerTokenAuthentication): Mono<String?> {
1211
1211
----
1212
1212
====
1213
1213
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:
0 commit comments