use of org.eclipse.jetty.client.api.AuthenticationStore in project jetty.project by eclipse.
the class HttpAuthenticationStoreTest method testFindAuthenticationResultWithDefaultHTTPPort.
@Test
public void testFindAuthenticationResultWithDefaultHTTPPort() throws Exception {
AuthenticationStore store = new HttpAuthenticationStore();
store.addAuthenticationResult(new Authentication.Result() {
@Override
public URI getURI() {
return URI.create("http://host:80");
}
@Override
public void apply(Request request) {
}
});
URI uri2 = URI.create("http://host");
Authentication.Result result = store.findAuthenticationResult(uri2);
Assert.assertNotNull(result);
store.clearAuthenticationResults();
// Flip the URIs.
store.addAuthenticationResult(new Authentication.Result() {
@Override
public URI getURI() {
return URI.create("https://server/");
}
@Override
public void apply(Request request) {
}
});
uri2 = URI.create("https://server:443/path");
result = store.findAuthenticationResult(uri2);
Assert.assertNotNull(result);
}
Aggregations