Search in sources :

Example 1 with Jersey2ApplicationClientFactoryBuilder

use of com.netflix.discovery.shared.transport.jersey2.Jersey2ApplicationClientFactory.Jersey2ApplicationClientFactoryBuilder in project eureka by Netflix.

the class AbstractJersey2EurekaHttpClientTest method getEurekaHttpClient.

@Override
protected EurekaHttpClient getEurekaHttpClient(URI serviceURI) {
    Jersey2ApplicationClientFactoryBuilder factoryBuilder = Jersey2ApplicationClientFactory.newBuilder();
    if (serviceURI.getUserInfo() != null) {
        factoryBuilder.withFeature(HttpAuthenticationFeature.basicBuilder().build());
    }
    TransportClientFactory clientFactory = factoryBuilder.build();
    jersey2HttpClient = (AbstractJersey2EurekaHttpClient) clientFactory.newClient(new DefaultEndpoint(serviceURI.toString()));
    return jersey2HttpClient;
}
Also used : DefaultEndpoint(com.netflix.discovery.shared.resolver.DefaultEndpoint) Jersey2ApplicationClientFactoryBuilder(com.netflix.discovery.shared.transport.jersey2.Jersey2ApplicationClientFactory.Jersey2ApplicationClientFactoryBuilder) TransportClientFactory(com.netflix.discovery.shared.transport.TransportClientFactory)

Aggregations

DefaultEndpoint (com.netflix.discovery.shared.resolver.DefaultEndpoint)1 TransportClientFactory (com.netflix.discovery.shared.transport.TransportClientFactory)1 Jersey2ApplicationClientFactoryBuilder (com.netflix.discovery.shared.transport.jersey2.Jersey2ApplicationClientFactory.Jersey2ApplicationClientFactoryBuilder)1