Search in sources :

Example 6 with IConfig

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;
}
Also used : IConfig(com.helger.config.IConfig) HttpPost(org.apache.http.client.methods.HttpPost) HttpHost(org.apache.http.HttpHost) Nonnull(javax.annotation.Nonnull)

Aggregations

IConfig (com.helger.config.IConfig)6 Nonnull (javax.annotation.Nonnull)6 FilenameHelper (com.helger.commons.io.file.FilenameHelper)1 SimpleFileIO (com.helger.commons.io.file.SimpleFileIO)1 StreamHelper (com.helger.commons.io.stream.StreamHelper)1 EWatchDirAction (com.helger.commons.io.watchdir.EWatchDirAction)1 IWatchDirCallback (com.helger.commons.io.watchdir.IWatchDirCallback)1 WatchDir (com.helger.commons.io.watchdir.WatchDir)1 StopWatch (com.helger.commons.timing.StopWatch)1 ResponseHandlerByteArray (com.helger.httpclient.response.ResponseHandlerByteArray)1 PeppolSBDHDocument (com.helger.peppol.sbdh.PeppolSBDHDocument)1 PeppolSBDHDocumentReader (com.helger.peppol.sbdh.read.PeppolSBDHDocumentReader)1 ESML (com.helger.peppol.sml.ESML)1 ESMPTransportProfile (com.helger.peppol.smp.ESMPTransportProfile)1 PeppolCertificateHelper (com.helger.peppol.utils.PeppolCertificateHelper)1 IIdentifierFactory (com.helger.peppolid.factory.IIdentifierFactory)1 PeppolIdentifierFactory (com.helger.peppolid.factory.PeppolIdentifierFactory)1 CAS4 (com.helger.phase4.CAS4)1 AS4ClientSentMessage (com.helger.phase4.client.AS4ClientSentMessage)1 AS4ClientUserMessage (com.helger.phase4.client.AS4ClientUserMessage)1