@Test public void testResolve() { MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) messageFactory.newMessage("bacon", CONTENT, ENCODING, METADATA); message.addPayload("cake", PAYLOAD); message.switchPayload("bacon"); assertEquals(CONTENT.length() + "," + CONTENT, message.resolve("%message{%size},%payload_id{bacon}", true)); assertEquals(CONTENT.length() + "," + CONTENT, message.resolve("%message{%size},%payload_id{bacon}", false)); assertEquals(CONTENT.length() + "," + CONTENT, message.resolve("%message{%size},%payload{id:bacon}", true)); assertEquals(CONTENT.length() + "," + CONTENT, message.resolve("%message{%size},%payload{id:bacon}", false)); assertEquals(new String(PAYLOAD), message.resolve("%payload_id{cake}")); assertNull(message.resolve(null)); assertEquals("VALUE", message.resolve("%message{KEY}")); try { message.resolve("%payload_id{fail}"); fail(); } catch (Exception e) { } }
@Override public AdaptrisMessage newMessage(byte[] payload) { return newMessage(defaultPayloadId(), payload, null); }
MultiPayloadMessageFactory extends AdaptrisMessageFactory { @Override public AdaptrisMessage newMessage(byte[] payload) { return newMessage(defaultPayloadId(), payload, null); } }
MultiPayloadMessageFactory extends AdaptrisMessageFactory { @Override public AdaptrisMessage newMessage(byte[] payload) { return newMessage(defaultPayloadId(), payload, null); } MultiPayloadMessageFactory(); }
MultiPayloadMessageFactory extends AdaptrisMessageFactory { @Override public AdaptrisMessage newMessage(byte[] payload) { return newMessage(defaultPayloadId(), payload, null); } MultiPayloadMessageFactory(); @Override AdaptrisMessage newMessage(byte[] payload); AdaptrisMessage newMessage(@NotNull String payloadId, byte[] payload); @Override AdaptrisMessage newMessage(byte[] payload, Set metadata); AdaptrisMessage newMessage(@NotNull String payloadId, byte[] payload, Set metadata); @Override AdaptrisMessage newMessage(String payload); @Override AdaptrisMessage newMessage(String payload, String charEncoding); @Override AdaptrisMessage newMessage(String payload, Set metadata); @Override AdaptrisMessage newMessage(String payload, String charEncoding, Set metadata); AdaptrisMessage newMessage(@NotNull String payloadId, String content, String charEncoding); AdaptrisMessage newMessage(@NotNull String payloadId, String content, String charEncoding, Set metadata); @Override AdaptrisMessage newMessage(AdaptrisMessage source, Collection<String> metadataKeysToPreserve); AdaptrisMessage newMessage(@NotNull String payloadId, AdaptrisMessage source,
      Collection<String> metadataKeysToPreserve); @Override AdaptrisMessage newMessage(); @Override String getDefaultCharEncoding(); @Override void setDefaultCharEncoding(String s); String getDefaultPayloadId(); void setDefaultPayloadId(String defaultPayloadId); }
MultiPayloadMessageFactory extends AdaptrisMessageFactory { @Override public AdaptrisMessage newMessage(byte[] payload) { return newMessage(defaultPayloadId(), payload, null); } MultiPayloadMessageFactory(); @Override AdaptrisMessage newMessage(byte[] payload); AdaptrisMessage newMessage(@NotNull String payloadId, byte[] payload); @Override AdaptrisMessage newMessage(byte[] payload, Set metadata); AdaptrisMessage newMessage(@NotNull String payloadId, byte[] payload, Set metadata); @Override AdaptrisMessage newMessage(String payload); @Override AdaptrisMessage newMessage(String payload, String charEncoding); @Override AdaptrisMessage newMessage(String payload, Set metadata); @Override AdaptrisMessage newMessage(String payload, String charEncoding, Set metadata); AdaptrisMessage newMessage(@NotNull String payloadId, String content, String charEncoding); AdaptrisMessage newMessage(@NotNull String payloadId, String content, String charEncoding, Set metadata); @Override AdaptrisMessage newMessage(AdaptrisMessage source, Collection<String> metadataKeysToPreserve); AdaptrisMessage newMessage(@NotNull String payloadId, AdaptrisMessage source,
      Collection<String> metadataKeysToPreserve); @Override AdaptrisMessage newMessage(); @Override String getDefaultCharEncoding(); @Override void setDefaultCharEncoding(String s); String getDefaultPayloadId(); void setDefaultPayloadId(String defaultPayloadId);  }