@Test public void testSendMessage() throws MessageQueueCommunicationException { MockTestMessage message = new MockTestMessage(); message.setTest(UUID.randomUUID().toString()); TransferMessage tm = new TransferMessage(); EasyMock.expect(converterMock.convertToTransferMessage(message)).andReturn(tm); EasyMock.expect(converterMock.getContentType()).andReturn(TMContentType.JSON); senderMock.sendMessageInternal(tm); EasyMock.replay(converterMock, senderMock); CommunoteMessageSenderImpl impl = new CommunoteMessageSenderImpl(); impl.setConverter(converterMock); impl.setSender(senderMock); impl.sendMessage(message, message.getClass().getSimpleName(), "1.0"); EasyMock.verify(senderMock); }
@Override public void sendMessage(BaseMessage message, String messageType, String version) throws MessageQueueCommunicationException { TransferMessage tm = converter.convertToTransferMessage(message); tm.putHeader(TransferMessage.HEADER_MESSAGE_TYPE, messageType); tm.putHeader(TransferMessage.HEADER_MESSAGE_VERSION, version); tm.putHeader(TransferMessage.HEADER_CONTENT_TYPE, converter.getContentType().toString()); sender.sendMessageInternal(tm); }
CommunoteMessageSenderImpl implements CommunoteMessageSender { @Override public void sendMessage(BaseMessage message, String messageType, String version) throws MessageQueueCommunicationException { TransferMessage tm = converter.convertToTransferMessage(message); tm.putHeader(TransferMessage.HEADER_MESSAGE_TYPE, messageType); tm.putHeader(TransferMessage.HEADER_MESSAGE_VERSION, version); tm.putHeader(TransferMessage.HEADER_CONTENT_TYPE, converter.getContentType().toString()); sender.sendMessageInternal(tm); } }
CommunoteMessageSenderImpl implements CommunoteMessageSender { @Override public void sendMessage(BaseMessage message, String messageType, String version) throws MessageQueueCommunicationException { TransferMessage tm = converter.convertToTransferMessage(message); tm.putHeader(TransferMessage.HEADER_MESSAGE_TYPE, messageType); tm.putHeader(TransferMessage.HEADER_MESSAGE_VERSION, version); tm.putHeader(TransferMessage.HEADER_CONTENT_TYPE, converter.getContentType().toString()); sender.sendMessageInternal(tm); }  }
CommunoteMessageSenderImpl implements CommunoteMessageSender { @Override public void sendMessage(BaseMessage message, String messageType, String version) throws MessageQueueCommunicationException { TransferMessage tm = converter.convertToTransferMessage(message); tm.putHeader(TransferMessage.HEADER_MESSAGE_TYPE, messageType); tm.putHeader(TransferMessage.HEADER_MESSAGE_VERSION, version); tm.putHeader(TransferMessage.HEADER_CONTENT_TYPE, converter.getContentType().toString()); sender.sendMessageInternal(tm); }  @Override void sendMessage(BaseMessage message, String messageType, String version); @Override void sendReplyMessage(CommunoteReplyMessage message); }
CommunoteMessageSenderImpl implements CommunoteMessageSender { @Override public void sendMessage(BaseMessage message, String messageType, String version) throws MessageQueueCommunicationException { TransferMessage tm = converter.convertToTransferMessage(message); tm.putHeader(TransferMessage.HEADER_MESSAGE_TYPE, messageType); tm.putHeader(TransferMessage.HEADER_MESSAGE_VERSION, version); tm.putHeader(TransferMessage.HEADER_CONTENT_TYPE, converter.getContentType().toString()); sender.sendMessageInternal(tm); }  @Override void sendMessage(BaseMessage message, String messageType, String version); @Override void sendReplyMessage(CommunoteReplyMessage message);  }