@Test void create() throws NoSuchFieldException, IllegalAccessException { mockChannelHandlerContextChannelId(ctx, "abcedf"); final ChannelFuture channelFuture = Mockito.mock(ChannelFuture.class); Mockito.when(ctx.writeAndFlush(Mockito.anyObject())).thenReturn(channelFuture); final TestProbe<DssRestMasterActorCommand> testProbe = testKit.createTestProbe(); final DssRestHandler handler = newDssRestHandlerForTest(testProbe); addChannelHandlerContextToDssRestHandlerMap(handler, ctx); final ActorRef<DssRestChannelHandlerCommand> handlerActorRef = testKit.spawn(handler.create()); assertNotNull(handlerActorRef); handlerActorRef.tell(DssRestChannelHandlerCommandResponse.builder().channelId("abcedf").build()); }
@Override public Behavior<DssRestChannelHandlerCommand> create() { if (initializeBehavior.get()) { throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twice for one object"); } initializeBehavior.set(true); return Behaviors.setup(this::dssRestHandler); }
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override public Behavior<DssRestChannelHandlerCommand> create() { if (initializeBehavior.get()) { throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twice for one object"); } initializeBehavior.set(true); return Behaviors.setup(this::dssRestHandler); } }
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override public Behavior<DssRestChannelHandlerCommand> create() { if (initializeBehavior.get()) { throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twice for one object"); } initializeBehavior.set(true); return Behaviors.setup(this::dssRestHandler); } DssRestHandler(
            ActorRef<DssRestChannelInitializerCommand> restChannelInitializerActor,
            ActorRef<DssRestMasterActorCommand> restMasterActorRef,
            String name); }
DssRestHandler extends SimpleChannelInboundHandler<Object> implements DssHandler<DssRestChannelHandlerCommand> { @Override public Behavior<DssRestChannelHandlerCommand> create() { if (initializeBehavior.get()) { throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twice for one object"); } initializeBehavior.set(true); return Behaviors.setup(this::dssRestHandler); } 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 public Behavior<DssRestChannelHandlerCommand> create() { if (initializeBehavior.get()) { throw new DssUserActorDuplicateBehaviorCreateException("Cannot setup twice for one object"); } initializeBehavior.set(true); return Behaviors.setup(this::dssRestHandler); } 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();  }