use of org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_8Test method testNoBodyWithUnknownMessageAnnotation.
public void testNoBodyWithUnknownMessageAnnotation() throws Exception {
Message_1_0 sourceMessage = createTestMessage(new MessageAnnotations(Collections.singletonMap(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), null);
final AMQMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class));
assertEquals("Unexpected mime type", null, convertedMessage.getMessageHeader().getMimeType());
assertEquals("Unexpected content size", 0, convertedMessage.getMessageMetaData().getContentSize());
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations in project qpid-broker-j by apache.
the class MessageConverter_v1_0_to_InternalTest method testNoBodyWithUnknownMessageAnnotationWithContentType.
public void testNoBodyWithUnknownMessageAnnotationWithContentType() throws Exception {
final String mimeType = "foo/bar";
Properties properties = new Properties();
properties.setContentType(Symbol.valueOf(mimeType));
Message_1_0 sourceMessage = createTestMessage(properties, new MessageAnnotations(Collections.singletonMap(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), null);
final InternalMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class));
assertEquals("Unexpected mime type", mimeType, convertedMessage.getMessageHeader().getMimeType());
assertEquals("Unexpected content", null, convertedMessage.getMessageBody());
}
Aggregations