浏览代码

Polish Deprecations

Issue gh-4080
Rob Winch 9 年之前
父节点
当前提交
6a3a5f7beb

+ 3 - 1
test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomConfigAuthenticationTests.java

@@ -17,6 +17,7 @@ package org.springframework.security.test.web.servlet.showcase.login;
 
 import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.*;
 import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
+import static org.springframework.security.test.web.servlet.response.RedirectMatcher.redirectUrl;
 import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.*;
 import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
@@ -70,7 +71,8 @@ public class CustomConfigAuthenticationTests {
 
 	@Test
 	public void withUserSuccess() throws Exception {
-		mvc.perform(get("/").with(user("user"))).andExpect(status().isNotFound())
+		mvc.perform(get("/").with(user("user")))
+				.andExpect(status().isNotFound())
 				.andExpect(authenticated().withUsername("user"));
 	}
 

+ 3 - 2
test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomLoginRequestBuilderAuthenticationTests.java

@@ -55,7 +55,8 @@ public class CustomLoginRequestBuilderAuthenticationTests {
 
 	@Test
 	public void authenticationSuccess() throws Exception {
-		mvc.perform(login()).andExpect(status().isMovedTemporarily())
+		mvc.perform(login())
+				.andExpect(status().isFound())
 				.andExpect(redirectUrl("/"))
 				.andExpect(authenticated().withUsername("user"));
 	}
@@ -63,7 +64,7 @@ public class CustomLoginRequestBuilderAuthenticationTests {
 	@Test
 	public void authenticationFailed() throws Exception {
 		mvc.perform(login().user("notfound").password("invalid"))
-				.andExpect(status().isMovedTemporarily())
+				.andExpect(status().isFound())
 				.andExpect(redirectUrl("/authenticate?error"))
 				.andExpect(unauthenticated());
 	}