use of com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService in project odata-client by davidmoten.
the class CarServiceTest method testWithApacheHttpService.
@Test
public void testWithApacheHttpService() throws Exception {
Path basePath = new Path("http://localhost:8090/cars.svc", PathStyle.IDENTIFIERS_IN_ROUND_BRACKETS);
HttpService service = new ApacheHttpClientHttpService(basePath);
checkServiceCalls(service).stop();
}
use of com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService in project odata-client by davidmoten.
the class MicrosoftClientBuilder method createService.
@SuppressWarnings("resource")
private static <T> T createService(String baseUrl, Authenticator authenticator, //
long connectTimeoutMs, //
long readTimeoutMs, //
Optional<String> proxyHost, //
Optional<Integer> proxyPort, Optional<String> proxyUsername, Optional<String> proxyPassword, Optional<Supplier<CloseableHttpClient>> supplier, Optional<Function<HttpClientBuilder, HttpClientBuilder>> httpClientBuilderExtras, //
Creator<T> creator, //
String authenticationEndpoint, //
Function<? super HttpService, ? extends HttpService> httpServiceTransformer, List<SchemaInfo> schemas, PathStyle pathStyle) {
final Supplier<CloseableHttpClient> clientSupplier = createClientSupplier(connectTimeoutMs, readTimeoutMs, proxyHost, proxyPort, proxyUsername, proxyPassword, supplier, httpClientBuilderExtras);
Path basePath = new Path(baseUrl, pathStyle);
HttpService httpService = new //
ApacheHttpClientHttpService(//
basePath, //
clientSupplier, authenticator::authenticate);
httpService = httpServiceTransformer.apply(httpService);
return creator.create(new Context(Serializer.INSTANCE, httpService, createProperties(), schemas));
}
Aggregations