Przeglądaj źródła

SEC-2054: Polish

Fix the tests to use .getName() for assertions
Rob Winch 10 lat temu
rodzic
commit
2e1e9885ec

+ 2 - 2
web/src/test/java/org/springframework/security/web/authentication/www/BasicAuthenticationFilterTests.java

@@ -150,7 +150,7 @@ public class BasicAuthenticationFilterTests {
 
         verify(chain).doFilter(any(ServletRequest.class), any(ServletResponse.class));
         assertThat(SecurityContextHolder.getContext().getAuthentication()).isNotNull();
-        assertThat(SecurityContextHolder.getContext().getAuthentication()).isEqualTo("rod");
+        assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("rod");
     }
 
     @Test
@@ -195,7 +195,7 @@ public class BasicAuthenticationFilterTests {
 
         // Test
         assertThat(SecurityContextHolder.getContext().getAuthentication()).isNotNull();
-        assertThat(SecurityContextHolder.getContext().getAuthentication()).isEqualTo("rod");
+        assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("rod");
 
         // NOW PERFORM FAILED AUTHENTICATION