mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-09 06:50:05 +00:00
Fix deprecations
Issue gh-4080
This commit is contained in:
parent
2c99cd3bbf
commit
17cfd4707b
@ -54,7 +54,7 @@ public class AuthenticationTests {
|
||||
|
||||
@Test
|
||||
public void requiresAuthentication() throws Exception {
|
||||
mvc.perform(get("/")).andExpect(status().isMovedTemporarily());
|
||||
mvc.perform(get("/")).andExpect(status().isFound());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -66,7 +66,7 @@ public class AuthenticationTests {
|
||||
|
||||
@Test
|
||||
public void authenticationSuccess() throws Exception {
|
||||
mvc.perform(formLogin()).andExpect(status().isMovedTemporarily())
|
||||
mvc.perform(formLogin()).andExpect(status().isFound())
|
||||
.andExpect(redirectedUrl("/"))
|
||||
.andExpect(authenticated().withUsername("user"));
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class AuthenticationTests {
|
||||
@Test
|
||||
public void authenticationFailed() throws Exception {
|
||||
mvc.perform(formLogin().user("user").password("invalid"))
|
||||
.andExpect(status().isMovedTemporarily())
|
||||
.andExpect(status().isFound())
|
||||
.andExpect(redirectedUrl("/login?error")).andExpect(unauthenticated());
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class CustomConfigAuthenticationTests {
|
||||
public void authenticationSuccess() throws Exception {
|
||||
mvc.perform(
|
||||
formLogin("/authenticate").user("user", "user").password("pass",
|
||||
"password")).andExpect(status().isMovedTemporarily())
|
||||
"password")).andExpect(status().isFound())
|
||||
.andExpect(redirectedUrl("/"))
|
||||
.andExpect(authenticated().withUsername("user"));
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class CustomConfigAuthenticationTests {
|
||||
public void authenticationFailed() throws Exception {
|
||||
mvc.perform(
|
||||
formLogin("/authenticate").user("user", "notfound").password("pass",
|
||||
"invalid")).andExpect(status().isMovedTemporarily())
|
||||
"invalid")).andExpect(status().isFound())
|
||||
.andExpect(redirectedUrl("/authenticate?error"))
|
||||
.andExpect(unauthenticated());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user