requestId = "ServerHandlerTest.testResponse";
HandlerHolder holder = new HandlerHolder(true, requestId);
readRequestAndAssert(holder);
ContextsContainer container = ContextAttributeStorageHelper.getContainer(holder.ctx, holder.requestId);
String ctx2Name = "ctx2";
BidirectionalTestContext ctx2 = new BidirectionalTestContext(ctx2Name);
container.addContext(ctx2Name, ctx2, new BidirectionalTestContextSerializer());
HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
holder.handler.write(holder.ctx, response, holder.ctx.newPromise());
ContextKeySupplier supplier = new HttpContextKeySupplier(response.headers());
ContextsContainer containerToRead = new ContextsContainerImpl(supplier);
Assert.assertEquals("Bi-directional context not written in response.", ctx2, containerToRead.getContext(
ctx2Name));
}