@Test
    void verifyErrorWithBadCredential() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        context.addHeader(HttpHeaders.AUTHORIZATION,
            SpnegoConstants.NEGOTIATE + ' ' + EncodingUtils.encodeBase64("credential"));
        val stResolver = mock(CasWebflowEventResolver.class);
        val err = new EventFactorySupport().error(this);
        when(stResolver.resolveSingle(any())).thenReturn(err);
        val adaptive = mock(AdaptiveAuthenticationPolicy.class);
        when(adaptive.isAuthenticationRequestAllowed(any(), anyString(), any())).thenReturn(false);
        val action = new SpnegoCredentialsAction(mock(CasDelegatingWebflowEventResolver.class),
            stResolver, adaptive, false);
        assertEquals(CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, action.execute(context).getId());
    }
This is {@link SpnegoCredentialsActionTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-spnego-webflow/src/test/java/org/apereo/cas/web/flow/SpnegoCredentialsActionTests.java