Class SecurityMockMvcRequestBuilders
java.lang.Object
org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
Contains Spring Security related
MockMvc
RequestBuilder
s.- Since:
- 4.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a request (including any necessaryCsrfToken
) that will submit a form based login to POST "/login".Creates a request (including any necessaryCsrfToken
) that will submit a form based login to POSTloginProcessingUrl
.logout()
Creates a logout request.Creates a logout request (including any necessaryCsrfToken
) to the specifiedlogoutUrl
-
Method Details
-
formLogin
Creates a request (including any necessaryCsrfToken
) that will submit a form based login to POST "/login".- Returns:
- the FormLoginRequestBuilder for further customizations
-
formLogin
public static SecurityMockMvcRequestBuilders.FormLoginRequestBuilder formLogin(String loginProcessingUrl) Creates a request (including any necessaryCsrfToken
) that will submit a form based login to POSTloginProcessingUrl
.- Parameters:
loginProcessingUrl
- the URL to POST to- Returns:
- the FormLoginRequestBuilder for further customizations
-
logout
Creates a logout request.- Returns:
- the LogoutRequestBuilder for additional customizations
-
logout
Creates a logout request (including any necessaryCsrfToken
) to the specifiedlogoutUrl
- Parameters:
logoutUrl
- the logout request URL- Returns:
- the LogoutRequestBuilder for additional customizations
-