Search in sources :

Example 1 with MockInterceptor

use of com.predic8.membrane.core.interceptor.MockInterceptor in project service-proxy by membrane.

the class ServiceInvocationTest method createServiceRule.

private ServiceProxy createServiceRule() {
    ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost", "*", "*", 3012), "thomas-bayer.com", 80);
    rule.setName("log");
    rule.getInterceptors().add(new MockInterceptor("log"));
    return rule;
}
Also used : ServiceProxyKey(com.predic8.membrane.core.rules.ServiceProxyKey) ServiceProxy(com.predic8.membrane.core.rules.ServiceProxy) MockInterceptor(com.predic8.membrane.core.interceptor.MockInterceptor)

Example 2 with MockInterceptor

use of com.predic8.membrane.core.interceptor.MockInterceptor in project service-proxy by membrane.

the class ServiceInvocationTest method createFirstRule.

private ServiceProxy createFirstRule() {
    ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost", Request.METHOD_POST, "*", 3016), "thomas-bayer.com", 80);
    rule.setTargetURL("service:log");
    rule.getInterceptors().add(new MockInterceptor("process"));
    return rule;
}
Also used : ServiceProxyKey(com.predic8.membrane.core.rules.ServiceProxyKey) ServiceProxy(com.predic8.membrane.core.rules.ServiceProxy) MockInterceptor(com.predic8.membrane.core.interceptor.MockInterceptor)

Example 3 with MockInterceptor

use of com.predic8.membrane.core.interceptor.MockInterceptor in project service-proxy by membrane.

the class ServiceInvocationTest method createRouter.

private HttpRouter createRouter() throws Exception {
    HttpRouter router = new HttpRouter();
    router.getRuleManager().addProxyAndOpenPortIfNew(createFirstRule());
    router.getRuleManager().addProxyAndOpenPortIfNew(createServiceRule());
    router.getTransport().getInterceptors().add(router.getTransport().getInterceptors().size() - 1, new MockInterceptor("transport-log"));
    router.init();
    return router;
}
Also used : MockInterceptor(com.predic8.membrane.core.interceptor.MockInterceptor) HttpRouter(com.predic8.membrane.core.HttpRouter)

Aggregations

MockInterceptor (com.predic8.membrane.core.interceptor.MockInterceptor)3 ServiceProxy (com.predic8.membrane.core.rules.ServiceProxy)2 ServiceProxyKey (com.predic8.membrane.core.rules.ServiceProxyKey)2 HttpRouter (com.predic8.membrane.core.HttpRouter)1