use of com.helger.config.IConfig in project phase4 by phax.
the class AbstractUserMessageTestSetUp method _createPost.
@Nonnull
private HttpPost _createPost() {
final IConfig aConfig = AS4Configuration.getConfig();
final String sURL = MockJettySetup.getServerAddressFromSettings();
LOGGER.info("The following test case will only work if there is a local AS4 server running @ " + sURL);
final HttpPost aPost = new HttpPost(sURL);
if (aConfig.getAsBoolean(SETTINGS_SERVER_PROXY_ENABLED, false)) {
// E.g. using little proxy for faking "no response"
final HttpHost aProxyHost = new HttpHost(aConfig.getAsString(SETTINGS_SERVER_PROXY_ADDRESS), aConfig.getAsInt(SETTINGS_SERVER_PROXY_PORT));
LOGGER.info("Using proxy host " + aProxyHost.toString());
aPost.setConfig(RequestConfig.custom().setProxy(aProxyHost).build());
}
return aPost;
}
Aggregations