Class SecurityMockMvcRequestBuilders
- java.lang.Object
-
- org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
-
public final class SecurityMockMvcRequestBuilders extends Object
Contains Spring Security relatedMockMvc
RequestBuilder
s.- Since:
- 4.0
- Author:
- Rob Winch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
Creates a form based login request including any necessaryCsrfToken
.static class
SecurityMockMvcRequestBuilders.LogoutRequestBuilder
Creates a logout request (including any necessaryCsrfToken
)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
formLogin()
Creates a request (including any necessaryCsrfToken
) that will submit a form based login to POST "/login".static SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
formLogin(String loginProcessingUrl)
Creates a request (including any necessaryCsrfToken
) that will submit a form based login to POSTloginProcessingUrl
.static SecurityMockMvcRequestBuilders.LogoutRequestBuilder
logout()
Creates a logout request.static SecurityMockMvcRequestBuilders.LogoutRequestBuilder
logout(String logoutUrl)
Creates a logout request (including any necessaryCsrfToken
) to the specifiedlogoutUrl
-
-
-
Method Detail
-
formLogin
public static SecurityMockMvcRequestBuilders.FormLoginRequestBuilder 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
public static SecurityMockMvcRequestBuilders.LogoutRequestBuilder logout()
Creates a logout request.- Returns:
- the LogoutRequestBuilder for additional customizations
-
logout
public static SecurityMockMvcRequestBuilders.LogoutRequestBuilder logout(String logoutUrl)
Creates a logout request (including any necessaryCsrfToken
) to the specifiedlogoutUrl
- Returns:
- the LogoutRequestBuilder for additional customizations
-
-