Search in sources :

Example 1 with MockDirectClient

use of org.pac4j.core.client.MockDirectClient in project pac4j by pac4j.

the class DefaultCallbackLogicTests method testDirectClient.

@Test
public void testDirectClient() {
    request.addParameter(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER, NAME);
    final MockDirectClient directClient = new MockDirectClient(NAME, new MockCredentials(), new CommonProfile());
    config.setClients(new Clients(directClient));
    TestsHelper.expectException(() -> call(), TechnicalException.class, "unable to find one indirect client for the callback: check the callback URL for a client name parameter or" + " suffix path or ensure that your configuration defaults to one indirect client");
}
Also used : MockDirectClient(org.pac4j.core.client.MockDirectClient) MockCredentials(org.pac4j.core.credentials.MockCredentials) CommonProfile(org.pac4j.core.profile.CommonProfile) Clients(org.pac4j.core.client.Clients) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Clients (org.pac4j.core.client.Clients)1 MockDirectClient (org.pac4j.core.client.MockDirectClient)1 MockCredentials (org.pac4j.core.credentials.MockCredentials)1 CommonProfile (org.pac4j.core.profile.CommonProfile)1