DatagramDecoratedRequest implements DatagramMessage<byte[]> { public DatagramDecoratedRequest(DatagramDenominator denominator) { this.denominator = denominator; } DatagramDecoratedRequest(DatagramDenominator denominator); @Override byte[] toMessage(); @Override void addMessage(byte[] message); String getHost(); void setHost(String host); Integer getPort(); void setPort(Integer port); @Override String toString();  }
@Test void datagramDecoratedRequestTest() { DatagramDenominator denominator = new DatagramDenominator(DatagramBodyType.JSON.getType(), "/units/stringConsumer"); DatagramDecoratedRequest request = new DatagramDecoratedRequest(denominator); request.addMessage("{\"number\":22}".getBytes()); byte[] requestBytes = request.toMessage(); String requestMessage = new String(requestBytes); System.out.println("requestMessage: " + requestMessage); assertNotNull(requestBytes); assertTrue(requestBytes.length > 0); }