DynamicAuthenticationFilter extends FormAuthenticationFilter { boolean isAuthTypeNegotiate(final ServletRequest request) { final String authType = request.getParameter(DynamicAuthenticationFilter.PARAM_NAME_AUTHTYPE); return authType != null && DynamicAuthenticationFilter.PARAM_VAL_AUTHTYPE_NEGOTIATE.equalsIgnoreCase(authType); }   static final String PARAM_NAME_AUTHTYPE; static final String PARAM_VAL_AUTHTYPE_NEGOTIATE; }
@Test void testIsAuthTypeNegotiate() { Assertions.assertNotNull(new Expectations() { { DynamicAuthenticationFilterTest.this.request.getParameter(this.anyString); this.result = null; } }); Assertions.assertFalse(this.dynamicAuthenticationFilter.isAuthTypeNegotiate(this.request)); Assertions.assertNotNull(new Expectations() { { DynamicAuthenticationFilterTest.this.request.getParameter(this.anyString); this.result = "zzz"; } }); Assertions.assertFalse(this.dynamicAuthenticationFilter.isAuthTypeNegotiate(this.request)); Assertions.assertNotNull(new Expectations() { { DynamicAuthenticationFilterTest.this.request.getParameter(this.anyString); this.result = DynamicAuthenticationFilter.PARAM_VAL_AUTHTYPE_NEGOTIATE; } }); Assertions.assertTrue(this.dynamicAuthenticationFilter.isAuthTypeNegotiate(this.request)); }