Selaa lähdekoodia

Add failing test for #3905 Fix Assert usage

Ruben Dijkstra 9 vuotta sitten
vanhempi
commit
364db6762e

+ 9 - 0
web/src/test/java/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilterTests.java

@@ -418,6 +418,15 @@ public class AbstractAuthenticationProcessingFilterTests {
 		assertThat(response.getStatus()).isEqualTo(HttpServletResponse.SC_UNAUTHORIZED);
 	}
 
+	/**
+	 * https://github.com/spring-projects/spring-security/pull/3905
+	 */
+	@Test(expected = IllegalArgumentException.class)
+	public void setRememberMeServicesShouldntAllowNulls() {
+		AbstractAuthenticationProcessingFilter filter = new MockAuthenticationFilter();
+		filter.setRememberMeServices(null);
+	}
+
 	// ~ Inner Classes
 	// ==================================================================================================