@Test
    public void testNoTokenRedirectionExpected() {
        val configuration = new CasConfiguration();
        configuration.setLoginUrl(LOGIN_URL);
        val client = new DirectCasClient(configuration);
        val context = MockWebContext.create();
        context.setFullRequestURL(CALLBACK_URL);
        val action = (HttpAction) TestsHelper.expectException(()
            -> client.getCredentials(new CallContext(context, new MockSessionStore())));
        assertEquals(302, action.getCode());
        assertEquals(addParameter(LOGIN_URL, CasConfiguration.SERVICE_PARAMETER, CALLBACK_URL),
            ((FoundAction) action).getLocation());
    }
Tests the {@link DirectCasClient}.

@author Jerome Leleu
@since 1.9.2
pac4j-cas/src/test/java/org/pac4j/cas/client/direct/DirectCasClientTests.java