@Test void channelRead0() throws Exception { mockChannelHandlerContextChannelId(ctx, "abcedf"); final TestProbe<DssRestMasterActorCommand> testProbe = testKit.createTestProbe(); final DssRestHandler handler = newDssRestHandlerForTest(testProbe); testKit.spawn(handler.create()); handler.channelRead0(ctx, request); final HttpRequest httpRequest = getDssRestHandlerFieldWithReflection(handler, "request", HttpRequest.class); assertEquals(HttpVersion.HTTP_1_1, httpRequest.protocolVersion()); assertEquals(HttpMethod.GET, httpRequest.method()); assertEquals("/hi/hello", httpRequest.uri()); handler.channelRead0(ctx, content); final StringBuilder stringBuilder = getDssRestHandlerFieldWithReflection(handler, "buffer", StringBuilder.class); assertEquals("Hello", stringBuilder.toString()); }
@Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { request = (HttpRequest) msg; buffer.setLength(0); } if (msg instanceof HttpContent) { final HttpContent httpContent = (HttpContent) msg; final ByteBuf content = httpContent.content(); if (content.isReadable()) { buffer.append(content.toString(CharsetUtil.UTF_8)); } if (msg instanceof LastHttpContent) { final DssRestRequest dssRestRequest = dssRestRequest(request, buffer.toString()); handlingDssRestRequest(dssRestRequest, ctx); } } }
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { request = (HttpRequest) msg; buffer.setLength(0); } if (msg instanceof HttpContent) { final HttpContent httpContent = (HttpContent) msg; final ByteBuf content = httpContent.content(); if (content.isReadable()) { buffer.append(content.toString(CharsetUtil.UTF_8)); } if (msg instanceof LastHttpContent) { final DssRestRequest dssRestRequest = dssRestRequest(request, buffer.toString()); handlingDssRestRequest(dssRestRequest, ctx); } } } }
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { request = (HttpRequest) msg; buffer.setLength(0); } if (msg instanceof HttpContent) { final HttpContent httpContent = (HttpContent) msg; final ByteBuf content = httpContent.content(); if (content.isReadable()) { buffer.append(content.toString(CharsetUtil.UTF_8)); } if (msg instanceof LastHttpContent) { final DssRestRequest dssRestRequest = dssRestRequest(request, buffer.toString()); handlingDssRestRequest(dssRestRequest, ctx); } } } DssRestHandler(
            ActorRef<DssRestChannelInitializerCommand> restChannelInitializerActor,
            ActorRef<DssRestMasterActorCommand> restMasterActorRef,
            String name); }
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { request = (HttpRequest) msg; buffer.setLength(0); } if (msg instanceof HttpContent) { final HttpContent httpContent = (HttpContent) msg; final ByteBuf content = httpContent.content(); if (content.isReadable()) { buffer.append(content.toString(CharsetUtil.UTF_8)); } if (msg instanceof LastHttpContent) { final DssRestRequest dssRestRequest = dssRestRequest(request, buffer.toString()); handlingDssRestRequest(dssRestRequest, ctx); } } } DssRestHandler(
            ActorRef<DssRestChannelInitializerCommand> restChannelInitializerActor,
            ActorRef<DssRestMasterActorCommand> restMasterActorRef,
            String name); @Override void channelReadComplete(ChannelHandlerContext ctx); @Override void exceptionCaught(ChannelHandlerContext ctx, Throwable cause); @Override void channelUnregistered(ChannelHandlerContext ctx); @Override Behavior<DssRestChannelHandlerCommand> create(); }
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { request = (HttpRequest) msg; buffer.setLength(0); } if (msg instanceof HttpContent) { final HttpContent httpContent = (HttpContent) msg; final ByteBuf content = httpContent.content(); if (content.isReadable()) { buffer.append(content.toString(CharsetUtil.UTF_8)); } if (msg instanceof LastHttpContent) { final DssRestRequest dssRestRequest = dssRestRequest(request, buffer.toString()); handlingDssRestRequest(dssRestRequest, ctx); } } } DssRestHandler(
            ActorRef<DssRestChannelInitializerCommand> restChannelInitializerActor,
            ActorRef<DssRestMasterActorCommand> restMasterActorRef,
            String name); @Override void channelReadComplete(ChannelHandlerContext ctx); @Override void exceptionCaught(ChannelHandlerContext ctx, Throwable cause); @Override void channelUnregistered(ChannelHandlerContext ctx); @Override Behavior<DssRestChannelHandlerCommand> create();  }