Search in sources :

Example 26 with IApiConnection

use of io.apiman.gateway.engine.IApiConnection in project apiman by apiman.

the class StandardTLSTest method shouldAllowAllWhenDevMode.

/**
 * Scenario:
 *   - Development mode TLS pass-through. Accepts anything.
 */
@Test
public void shouldAllowAllWhenDevMode() {
    config.put(TLSOptions.TLS_DEVMODE, "true");
    HttpConnectorFactory factory = new HttpConnectorFactory(config);
    IApiConnector connector = factory.createConnector(request, api, RequiredAuthType.DEFAULT, false, new ConnectorConfigImpl());
    IApiConnection connection = connector.connect(request, new IAsyncResultHandler<IApiConnectionResponse>() {

        @Override
        public void handle(IAsyncResult<IApiConnectionResponse> result) {
            Assert.assertTrue(result.isSuccess());
        }
    });
    connection.end();
}
Also used : IApiConnection(io.apiman.gateway.engine.IApiConnection) HttpConnectorFactory(io.apiman.gateway.platforms.servlet.connectors.HttpConnectorFactory) ConnectorConfigImpl(io.apiman.gateway.platforms.servlet.connectors.ConnectorConfigImpl) IApiConnectionResponse(io.apiman.gateway.engine.IApiConnectionResponse) IApiConnector(io.apiman.gateway.engine.IApiConnector) Test(org.junit.Test)

Aggregations

IApiConnection (io.apiman.gateway.engine.IApiConnection)26 IApiConnector (io.apiman.gateway.engine.IApiConnector)26 ConnectorConfigImpl (io.apiman.gateway.platforms.servlet.connectors.ConnectorConfigImpl)26 HttpConnectorFactory (io.apiman.gateway.platforms.servlet.connectors.HttpConnectorFactory)26 Test (org.junit.Test)25 IApiConnectionResponse (io.apiman.gateway.engine.IApiConnectionResponse)18 IAsyncResult (io.apiman.gateway.engine.async.IAsyncResult)8 ConnectorException (io.apiman.gateway.engine.beans.exceptions.ConnectorException)6 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 X509Certificate (java.security.cert.X509Certificate)2 CountDownLatch (java.util.concurrent.CountDownLatch)1