public static final class SecurityMockMvcResultMatchers.AuthenticatedMatcher extends Object
Modifier and Type | Method and Description |
---|---|
void |
match(MvcResult result) |
SecurityMockMvcResultMatchers.AuthenticatedMatcher |
withAuthentication(Authentication expected)
Specifies the expected
Authentication |
SecurityMockMvcResultMatchers.AuthenticatedMatcher |
withAuthenticationName(String expected)
Specifies the expected
Principal.getName() |
SecurityMockMvcResultMatchers.AuthenticatedMatcher |
withAuthenticationPrincipal(Object expected)
Specifies the expected principal
|
SecurityMockMvcResultMatchers.AuthenticatedMatcher |
withAuthorities(Collection<GrantedAuthority> expected)
Specifies the
Authentication.getAuthorities() |
SecurityMockMvcResultMatchers.AuthenticatedMatcher |
withRoles(String... roles)
Specifies the
Authentication.getAuthorities() |
SecurityMockMvcResultMatchers.AuthenticatedMatcher |
withSecurityContext(SecurityContext expected)
Specifies the expected
SecurityContext |
SecurityMockMvcResultMatchers.AuthenticatedMatcher |
withUsername(String expected)
Specifies the expected username
|
public SecurityMockMvcResultMatchers.AuthenticatedMatcher withUsername(String expected)
expected
- the expected usernameSecurityMockMvcResultMatchers.AuthenticatedMatcher
for further customizationpublic SecurityMockMvcResultMatchers.AuthenticatedMatcher withSecurityContext(SecurityContext expected)
SecurityContext
expected
- the expected SecurityContext
SecurityMockMvcResultMatchers.AuthenticatedMatcher
for further customizationpublic SecurityMockMvcResultMatchers.AuthenticatedMatcher withAuthentication(Authentication expected)
Authentication
expected
- the expected Authentication
SecurityMockMvcResultMatchers.AuthenticatedMatcher
for further customizationpublic SecurityMockMvcResultMatchers.AuthenticatedMatcher withAuthenticationPrincipal(Object expected)
expected
- the expected principalSecurityMockMvcResultMatchers.AuthenticatedMatcher
for further customizationpublic SecurityMockMvcResultMatchers.AuthenticatedMatcher withAuthenticationName(String expected)
Principal.getName()
expected
- the expected Principal.getName()
SecurityMockMvcResultMatchers.AuthenticatedMatcher
for further customizationpublic SecurityMockMvcResultMatchers.AuthenticatedMatcher withAuthorities(Collection<GrantedAuthority> expected)
Authentication.getAuthorities()
expected
- the Authentication.getAuthorities()
SecurityMockMvcResultMatchers.AuthenticatedMatcher
for further customizationpublic SecurityMockMvcResultMatchers.AuthenticatedMatcher withRoles(String... roles)
Authentication.getAuthorities()
expected
- the roles. Each value is automatically prefixed with "ROLE_"SecurityMockMvcResultMatchers.AuthenticatedMatcher
for further customization