mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 09:12:14 +00:00
Add static imports to code snippets
Closes gh-6597
This commit is contained in:
parent
c69df9fba0
commit
e25117856e
@ -7,6 +7,8 @@ For example:
|
|||||||
.Java
|
.Java
|
||||||
[source,java,role="primary"]
|
[source,java,role="primary"]
|
||||||
----
|
----
|
||||||
|
import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.mockUser;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void messageWhenNotAuthenticated() throws Exception {
|
public void messageWhenNotAuthenticated() throws Exception {
|
||||||
this.rest
|
this.rest
|
||||||
@ -67,6 +69,7 @@ public void messageWhenMutateWithMockAdminThenOk() throws Exception {
|
|||||||
[source,kotlin,role="secondary"]
|
[source,kotlin,role="secondary"]
|
||||||
----
|
----
|
||||||
import org.springframework.test.web.reactive.server.expectBody
|
import org.springframework.test.web.reactive.server.expectBody
|
||||||
|
import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.mockUser
|
||||||
|
|
||||||
//...
|
//...
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ For example:
|
|||||||
.Java
|
.Java
|
||||||
[source,java,role="primary"]
|
[source,java,role="primary"]
|
||||||
----
|
----
|
||||||
|
import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf;
|
||||||
|
|
||||||
this.rest
|
this.rest
|
||||||
// provide a valid CSRF token
|
// provide a valid CSRF token
|
||||||
.mutateWith(csrf())
|
.mutateWith(csrf())
|
||||||
@ -18,6 +20,8 @@ this.rest
|
|||||||
.Kotlin
|
.Kotlin
|
||||||
[source,kotlin,role="secondary"]
|
[source,kotlin,role="secondary"]
|
||||||
----
|
----
|
||||||
|
import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf
|
||||||
|
|
||||||
this.rest
|
this.rest
|
||||||
// provide a valid CSRF token
|
// provide a valid CSRF token
|
||||||
.mutateWith(csrf())
|
.mutateWith(csrf())
|
||||||
|
@ -6,6 +6,9 @@ The basic setup looks like this:
|
|||||||
.Java
|
.Java
|
||||||
[source,java,role="primary"]
|
[source,java,role="primary"]
|
||||||
----
|
----
|
||||||
|
import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.springSecurity;
|
||||||
|
import static org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication;
|
||||||
|
|
||||||
@ExtendWith(SpringExtension.class)
|
@ExtendWith(SpringExtension.class)
|
||||||
@ContextConfiguration(classes = HelloWebfluxMethodApplication.class)
|
@ContextConfiguration(classes = HelloWebfluxMethodApplication.class)
|
||||||
public class HelloWebfluxMethodApplicationTests {
|
public class HelloWebfluxMethodApplicationTests {
|
||||||
@ -31,6 +34,9 @@ public class HelloWebfluxMethodApplicationTests {
|
|||||||
.Kotlin
|
.Kotlin
|
||||||
[source,kotlin,role="secondary"]
|
[source,kotlin,role="secondary"]
|
||||||
----
|
----
|
||||||
|
import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.springSecurity
|
||||||
|
import org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication
|
||||||
|
|
||||||
@ExtendWith(SpringExtension::class)
|
@ExtendWith(SpringExtension::class)
|
||||||
@ContextConfiguration(classes = [HelloWebfluxMethodApplication::class])
|
@ContextConfiguration(classes = [HelloWebfluxMethodApplication::class])
|
||||||
class HelloWebfluxMethodApplicationTests {
|
class HelloWebfluxMethodApplicationTests {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user