File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
docs/modules/ROOT/pages/reactive/test/web Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ For example:
7
7
.Java
8
8
[source,java,role="primary"]
9
9
----
10
+ import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.mockUser;
11
+
10
12
@Test
11
13
public void messageWhenNotAuthenticated() throws Exception {
12
14
this.rest
@@ -67,6 +69,7 @@ public void messageWhenMutateWithMockAdminThenOk() throws Exception {
67
69
[source,kotlin,role="secondary"]
68
70
----
69
71
import org.springframework.test.web.reactive.server.expectBody
72
+ import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.mockUser
70
73
71
74
//...
72
75
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ For example:
7
7
.Java
8
8
[source,java,role="primary"]
9
9
----
10
+ import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf;
11
+
10
12
this.rest
11
13
// provide a valid CSRF token
12
14
.mutateWith(csrf())
@@ -18,6 +20,8 @@ this.rest
18
20
.Kotlin
19
21
[source,kotlin,role="secondary"]
20
22
----
23
+ import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf
24
+
21
25
this.rest
22
26
// provide a valid CSRF token
23
27
.mutateWith(csrf())
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ The basic setup looks like this:
6
6
.Java
7
7
[source,java,role="primary"]
8
8
----
9
+ import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.springSecurity;
10
+ import static org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication;
11
+
9
12
@ExtendWith(SpringExtension.class)
10
13
@ContextConfiguration(classes = HelloWebfluxMethodApplication.class)
11
14
public class HelloWebfluxMethodApplicationTests {
@@ -31,6 +34,9 @@ public class HelloWebfluxMethodApplicationTests {
31
34
.Kotlin
32
35
[source,kotlin,role="secondary"]
33
36
----
37
+ import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.springSecurity
38
+ import org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication
39
+
34
40
@ExtendWith(SpringExtension::class)
35
41
@ContextConfiguration(classes = [HelloWebfluxMethodApplication::class])
36
42
class HelloWebfluxMethodApplicationTests {
You can’t perform that action at this time.
0 commit comments