Search in sources :

Example 1 with PathParameterCallbackUrlResolver

use of org.pac4j.core.http.callback.PathParameterCallbackUrlResolver in project pac4j by pac4j.

the class DefaultCallbackClientFinderTests method testPathParameter.

@Test
public void testPathParameter() {
    final IndirectClient azure = new MockIndirectClient("azure");
    azure.setCallbackUrlResolver(new PathParameterCallbackUrlResolver());
    final Clients clients = new Clients(CALLBACK_URL, azure);
    clients.init();
    final MockWebContext context = MockWebContext.create().setPath("/   AZURE   ");
    final ClientFinder finder = new DefaultCallbackClientFinder();
    final List<Client> result = finder.find(clients, context, null);
    assertEquals(1, result.size());
    assertEquals(azure, result.get(0));
}
Also used : MockWebContext(org.pac4j.core.context.MockWebContext) PathParameterCallbackUrlResolver(org.pac4j.core.http.callback.PathParameterCallbackUrlResolver) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 MockWebContext (org.pac4j.core.context.MockWebContext)1 PathParameterCallbackUrlResolver (org.pac4j.core.http.callback.PathParameterCallbackUrlResolver)1