### Question:
CompositeFixApplicationAdapter extends FixApplicationAdapter { @Override public void onMessage(ChannelHandlerContext ctx, FixMessage msg, List<Object> out) throws BusinessRejectException { assert (msg != null) : "Message can't be null"; LOGGER.info("Received : {}", msg); for (FixMessageValidator validator : validators) { validator.validate(ctx, msg); } if (handlers != null) { boolean isHandled = false; for (FixMessageHandler handler : handlers) { try { if (handler.handle(ctx, msg)) { isHandled = true; } } catch (Exception ex) { LOGGER.error("on {} ", handler.getClass(), ex); } } if (!isHandled) { LOGGER.warn("no handler for this message. {} ", msg); } } } CompositeFixApplicationAdapter(List<FixMessageValidator> validators, List<FixMessageHandler> handlers); @Override void onMessage(ChannelHandlerContext ctx, FixMessage msg, List<Object> out); @Override void beforeSendMessage(ChannelHandlerContext ctx, FixMessageBuilder msg);  }### Answer:
@Test public void testOnMessage() throws Exception { final FixMessage message = new FixMessageImpl(); when(messageHandler1.handle(same(ctx), same(message))).thenReturn(true); when(messageHandler2.handle(same(ctx), same(message))).thenReturn(false); adapter.onMessage(ctx, message, out); InOrder inOrder = inOrder( messageValidator1, messageValidator2, messageHandler1, messageHandler2, messageHandler3, ctx); inOrder.verify(messageValidator1).validate(same(ctx), same(message)); inOrder.verify(messageValidator2).validate(same(ctx), same(message)); inOrder.verify(messageHandler1).handle(same(ctx), same(message)); inOrder.verify(messageHandler2).handle(same(ctx), same(message)); }