Search in sources :

Example 21 with KnotContext

use of io.knotx.dataobjects.KnotContext in project knotx by Cognifide.

the class RequestProcessorKnotProxyImpl method createSuccessResponse.

private KnotContext createSuccessResponse(KnotContext inputContext) {
    ClientResponse clientResponse = new ClientResponse();
    String responseBody = getResponseBodyAsString(inputContext);
    clientResponse.setBody(Buffer.buffer(responseBody)).setHeaders(getHeaders(clientResponse, responseBody.length()));
    clientResponse.setStatusCode(HttpResponseStatus.OK.code());
    return new KnotContext().setClientRequest(inputContext.getClientRequest()).setClientResponse(clientResponse);
}
Also used : ClientResponse(io.knotx.dataobjects.ClientResponse) KnotContext(io.knotx.dataobjects.KnotContext)

Aggregations

KnotContext (io.knotx.dataobjects.KnotContext)21 KnotxConfiguration (io.knotx.junit.rule.KnotxConfiguration)10 Test (org.junit.Test)10 ClientResponse (io.knotx.dataobjects.ClientResponse)6 Vertx (io.vertx.reactivex.core.Vertx)6 Fragment (io.knotx.dataobjects.Fragment)4 KnotProxy (io.knotx.reactivex.proxy.KnotProxy)4 HttpResponseStatus (io.netty.handler.codec.http.HttpResponseStatus)4 Logback (io.knotx.junit.rule.Logback)3 TestVertxDeployer (io.knotx.junit.rule.TestVertxDeployer)3 KnotxServerConfiguration (io.knotx.server.configuration.KnotxServerConfiguration)3 Handler (io.vertx.core.Handler)3 Logger (io.vertx.core.logging.Logger)3 LoggerFactory (io.vertx.core.logging.LoggerFactory)3 Async (io.vertx.ext.unit.Async)3 TestContext (io.vertx.ext.unit.TestContext)3 RunTestOnContext (io.vertx.ext.unit.junit.RunTestOnContext)3 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)3 MultiMap (io.vertx.reactivex.core.MultiMap)3 RoutingContext (io.vertx.reactivex.ext.web.RoutingContext)3