@Test public void testGetJmsDestinationWithEmptyLegacyTypeAnnotationWithQueueConsumerDest() throws Exception { String testAddress = "testAddress"; AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class); AmqpConnection conn = Mockito.mock(AmqpConnection.class); Mockito.when(message.getConnection()).thenReturn(conn); Mockito.when(message.getToAddress()).thenReturn(testAddress); Mockito.when(message.getMessageAnnotation(LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL)).thenReturn(""); JmsQueue consumerDestination = new JmsQueue("ConsumerDestination"); JmsDestination destination = AmqpDestinationHelper.getJmsDestination(message, consumerDestination); assertNotNull(destination); assertTrue(destination.isQueue()); assertFalse(destination.isTemporary()); assertEquals(testAddress, destination.getAddress()); }
public static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination) { String to = message.getToAddress(); byte typeByte = getTypeByte(message, JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL); if (typeByte == UNKNOWN_TYPE) { typeByte = getTypeByte(message, AmqpMessageSupport.LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL); } String name = stripPrefixIfNecessary(to, message.getConnection(), typeByte, consumerDestination); return createDestination(name, typeByte, consumerDestination, false); }
AmqpDestinationHelper { public static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination) { String to = message.getToAddress(); byte typeByte = getTypeByte(message, JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL); if (typeByte == UNKNOWN_TYPE) { typeByte = getTypeByte(message, AmqpMessageSupport.LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL); } String name = stripPrefixIfNecessary(to, message.getConnection(), typeByte, consumerDestination); return createDestination(name, typeByte, consumerDestination, false); } }
AmqpDestinationHelper { public static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination) { String to = message.getToAddress(); byte typeByte = getTypeByte(message, JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL); if (typeByte == UNKNOWN_TYPE) { typeByte = getTypeByte(message, AmqpMessageSupport.LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL); } String name = stripPrefixIfNecessary(to, message.getConnection(), typeByte, consumerDestination); return createDestination(name, typeByte, consumerDestination, false); }  }
AmqpDestinationHelper { public static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination) { String to = message.getToAddress(); byte typeByte = getTypeByte(message, JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL); if (typeByte == UNKNOWN_TYPE) { typeByte = getTypeByte(message, AmqpMessageSupport.LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL); } String name = stripPrefixIfNecessary(to, message.getConnection(), typeByte, consumerDestination); return createDestination(name, typeByte, consumerDestination, false); }  static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static JmsDestination getJmsReplyTo(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static void setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setReplyToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static void setReplyToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static String getDestinationAddress(JmsDestination destination, AmqpConnection connection); static Symbol toTypeCapability(JmsDestination destination); }
AmqpDestinationHelper { public static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination) { String to = message.getToAddress(); byte typeByte = getTypeByte(message, JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL); if (typeByte == UNKNOWN_TYPE) { typeByte = getTypeByte(message, AmqpMessageSupport.LEGACY_TO_TYPE_MSG_ANNOTATION_SYMBOL); } String name = stripPrefixIfNecessary(to, message.getConnection(), typeByte, consumerDestination); return createDestination(name, typeByte, consumerDestination, false); }  static JmsDestination getJmsDestination(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static JmsDestination getJmsReplyTo(AmqpJmsMessageFacade message, JmsDestination consumerDestination); static void setToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setReplyToAddressFromDestination(AmqpJmsMessageFacade message, JmsDestination destination); static void setToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static void setReplyToAnnotationFromDestination(JmsDestination destination, MessageAnnotations annotations); static String getDestinationAddress(JmsDestination destination, AmqpConnection connection); static Symbol toTypeCapability(JmsDestination destination); static final Symbol JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL; static final Symbol JMS_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL; static final byte QUEUE_TYPE; static final byte TOPIC_TYPE; static final byte TEMP_QUEUE_TYPE; static final byte TEMP_TOPIC_TYPE; static final Symbol QUEUE_CAPABILITY; static final Symbol TOPIC_CAPABILITY; static final Symbol TEMP_QUEUE_CAPABILITY; static final Symbol TEMP_TOPIC_CAPABILITY; static final byte UNKNOWN_TYPE; }