@Test public void testSend() throws IOException { asyncRpcSender.attach(outputStream); prepareSequentialExecutorService(); Message message = () -> MessageType.REQUEST; given(objectMapper.writer()).willReturn(objectWriter); doNothing().when(objectWriter).writeValue(outputStream, message); asyncRpcSender.send(message); verify(objectMapper).writer(); verify(objectWriter).writeValue(outputStream, message); }
@Override public void send(Message message) { this.executorService.submit(() -> sendMessage(message)); }
AsyncRpcSender implements RpcSender { @Override public void send(Message message) { this.executorService.submit(() -> sendMessage(message)); } }
AsyncRpcSender implements RpcSender { @Override public void send(Message message) { this.executorService.submit(() -> sendMessage(message)); } AsyncRpcSender(ExecutorService executorService, ObjectMapper msgPacker); }
AsyncRpcSender implements RpcSender { @Override public void send(Message message) { this.executorService.submit(() -> sendMessage(message)); } AsyncRpcSender(ExecutorService executorService, ObjectMapper msgPacker); @Override void send(Message message); @Override void attach(OutputStream outputStream); @Override void stop(); }
AsyncRpcSender implements RpcSender { @Override public void send(Message message) { this.executorService.submit(() -> sendMessage(message)); } AsyncRpcSender(ExecutorService executorService, ObjectMapper msgPacker); @Override void send(Message message); @Override void attach(OutputStream outputStream); @Override void stop();  }