use of org.nhindirect.config.providers.ConfigJSONProvider in project nhin-d by DirectProject.
the class BaseTestPlan method getResource.
public static WebResource getResource(String serviceURL) {
final ClientConfig config = new DefaultClientConfig();
config.getSingletons().add(new ConfigJSONProvider());
// need to set timeouts so we don't block forever in the event of a bad URL or hung web server
config.getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, CONNECTION_TIMEOUT);
config.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, READ_TIMEOUT);
final Client client = Client.create(config);
WebResource resource = client.resource(serviceURL);
return resource;
}
Aggregations