Search in sources :

Example 1 with SimpleTestTokenAuthenticator

use of org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator in project pac4j by pac4j.

the class DirectDigestAuthClientTests method testMissingProfileCreator.

@Test
public void testMissingProfileCreator() {
    final DirectDigestAuthClient digestAuthClient = new DirectDigestAuthClient(new SimpleTestTokenAuthenticator(), null);
    TestsHelper.expectException(() -> digestAuthClient.getUserProfile(new DigestCredentials(TOKEN, HTTP_METHOD.POST.name(), null, null, null, null, null, null, null), MockWebContext.create()), TechnicalException.class, "profileCreator cannot be null");
}
Also used : DigestCredentials(org.pac4j.http.credentials.DigestCredentials) SimpleTestTokenAuthenticator(org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator) Test(org.junit.Test)

Example 2 with SimpleTestTokenAuthenticator

use of org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator in project pac4j by pac4j.

the class HeaderClientTests method testHasDefaultProfileCreator.

@Test
public void testHasDefaultProfileCreator() {
    final HeaderClient client = new HeaderClient(HEADER_NAME, new SimpleTestTokenAuthenticator());
    client.init();
}
Also used : SimpleTestTokenAuthenticator(org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator) Test(org.junit.Test)

Example 3 with SimpleTestTokenAuthenticator

use of org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator in project pac4j by pac4j.

the class HeaderClientTests method testMissingProfileCreator.

@Test
public void testMissingProfileCreator() {
    final HeaderClient client = new HeaderClient(NAME, new SimpleTestTokenAuthenticator());
    client.setProfileCreator(null);
    TestsHelper.expectException(() -> client.getUserProfile(new TokenCredentials(TOKEN), MockWebContext.create()), TechnicalException.class, "profileCreator cannot be null");
}
Also used : SimpleTestTokenAuthenticator(org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator) TokenCredentials(org.pac4j.core.credentials.TokenCredentials) Test(org.junit.Test)

Example 4 with SimpleTestTokenAuthenticator

use of org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator in project pac4j by pac4j.

the class IpClientTests method testHasDefaultProfileCreator.

@Test
public void testHasDefaultProfileCreator() {
    final IpClient client = new IpClient(new SimpleTestTokenAuthenticator());
    client.init();
}
Also used : SimpleTestTokenAuthenticator(org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator) Test(org.junit.Test)

Example 5 with SimpleTestTokenAuthenticator

use of org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator in project pac4j by pac4j.

the class ParameterClientTests method testMissingParameterName.

@Test
public void testMissingParameterName() {
    final ParameterClient client = new ParameterClient(null, new SimpleTestTokenAuthenticator());
    TestsHelper.initShouldFail(client, "parameterName cannot be blank");
}
Also used : SimpleTestTokenAuthenticator(org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)17 SimpleTestTokenAuthenticator (org.pac4j.http.credentials.authenticator.test.SimpleTestTokenAuthenticator)17 TokenCredentials (org.pac4j.core.credentials.TokenCredentials)8 MockWebContext (org.pac4j.core.context.MockWebContext)4 CommonProfile (org.pac4j.core.profile.CommonProfile)4 Cookie (org.pac4j.core.context.Cookie)1 DigestCredentials (org.pac4j.http.credentials.DigestCredentials)1