use of core.framework.http.HTTPClientBuilder in project core-ng-project by neowu.
the class APIConfig method httpClient.
private HTTPClient httpClient() {
if (state.httpClient == null) {
HTTPClient httpClient = new HTTPClientBuilder().userAgent("APIClient").timeout(state.timeout).slowOperationThreshold(state.slowOperationThreshold).build();
context.shutdownHook.add(httpClient::close);
state.httpClient = httpClient;
}
return state.httpClient;
}
use of core.framework.http.HTTPClientBuilder in project core-ng-project by neowu.
the class TestModule method initialize.
@Override
protected void initialize() {
loadProperties("test.properties");
// in test context, override binding is defined before actual binding
overrideBinding(HTTPClient.class, Mockito.mock(HTTPClient.class));
bind(HTTPClient.class, new HTTPClientBuilder().build());
configureDB();
configureMongo();
configureSearch();
configureKafka();
redis().host("localhost");
log().writeToConsole();
site().session().redis("localhost");
configureHTTP();
bind(new TestBean(requiredProperty("test.inject-test.property")));
}
Aggregations