mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-08 23:27:27 +00:00
This commit removes unnecessary main-branch merges starting from 8750608b5bca45525c99d0a41a20ed02de93d8c7 and adds the following needed commit(s) that were made afterward: - 5dce82c48bc0b174838501c5a111b2de70822914
23 lines
706 B
Plaintext
23 lines
706 B
Plaintext
== SecurityMockMvcRequestBuilders
|
|
|
|
Spring MVC Test also provides a `RequestBuilder` interface that can be used to create the `MockHttpServletRequest` used in your test.
|
|
Spring Security provides a few `RequestBuilder` implementations that can be used to make testing easier.
|
|
In order to use Spring Security's `RequestBuilder` implementations ensure the following static import is used:
|
|
|
|
[tabs]
|
|
======
|
|
Java::
|
|
+
|
|
[source,java,role="primary"]
|
|
----
|
|
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.*;
|
|
----
|
|
|
|
Kotlin::
|
|
+
|
|
[source,kotlin,role="secondary"]
|
|
----
|
|
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.*
|
|
----
|
|
======
|