parent
ab519a9667
commit
f54c344989
|
@ -1154,6 +1154,11 @@ You can use Spring Security's xref:servlet/test/mockmvc/setup.adoc[testing suppo
|
|||
.Java
|
||||
[source,java,role="primary"]
|
||||
----
|
||||
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
|
||||
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.*;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
|
||||
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ContextConfiguration(classes = SecurityConfig.class)
|
||||
@WebAppConfiguration
|
||||
|
@ -1192,6 +1197,11 @@ public class CsrfTests {
|
|||
.Kotlin
|
||||
[source,kotlin,role="secondary"]
|
||||
----
|
||||
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*
|
||||
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.*
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.*
|
||||
|
||||
@ExtendWith(SpringExtension::class)
|
||||
@ContextConfiguration(classes = [SecurityConfig::class])
|
||||
@WebAppConfiguration
|
||||
|
@ -1228,31 +1238,6 @@ class CsrfTests {
|
|||
----
|
||||
====
|
||||
|
||||
[TIP]
|
||||
====
|
||||
The above example uses the following static imports:
|
||||
|
||||
=====
|
||||
.Java
|
||||
[source,java,role="primary"]
|
||||
----
|
||||
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
|
||||
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.*;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
|
||||
----
|
||||
|
||||
.Kotlin
|
||||
[source,kotlin,role="secondary"]
|
||||
----
|
||||
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*
|
||||
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.*
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.*
|
||||
----
|
||||
=====
|
||||
====
|
||||
|
||||
[[disable-csrf]]
|
||||
== Disable CSRF Protection
|
||||
|
||||
|
|
Loading…
Reference in New Issue