### Question:
AmqpJmsMessagePropertyIntercepter { public static Object getProperty(AmqpJmsMessageFacade message, String name) throws JMSException { Object value = null; PropertyIntercepter propertyExpression = PROPERTY_INTERCEPTERS.get(name); if (propertyExpression != null) { value = propertyExpression.getProperty(message); } else { value = message.getApplicationProperty(name); } return value; }  static Object getProperty(AmqpJmsMessageFacade message, String name); static void setProperty(AmqpJmsMessageFacade message, String name, Object value); static boolean propertyExists(AmqpJmsMessageFacade message, String name); static Set<String> getAllPropertyNames(); static Set<String> getPropertyNames(AmqpJmsMessageFacade message); static void clearProperties(AmqpJmsMessageFacade message);  }### Answer:
@Test public void testGetPropertyWithNonInterceptedNameCallsIntoFacade() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); assertNull(AmqpJmsMessagePropertyIntercepter.getProperty(message, "SomeRandomPropertyName")); Mockito.verify(message).getApplicationProperty(Mockito.anyString()); }
@Test public void testGetJmsAmqpTtlWhenNotSet() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); assertNull(AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_TTL)); }
@Test public void testGetJmsAmqpTtlWhenSet() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); Mockito.when(message.hasAmqpTimeToLiveOverride()).thenReturn(true); Mockito.when(message.getAmqpTimeToLiveOverride()).thenReturn(65536L); assertNotNull(AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_TTL)); assertEquals(65536L, AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_TTL)); }
@Test public void testGetJmsAmqpReplyToGroupIdWhenNotSet() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); assertNull(AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_REPLY_TO_GROUP_ID)); }
@Test public void testGetJmsAmqpReplyToGroupIdWhenSet() throws JMSException { String testValue = "ReplyToGroupId"; AmqpJmsMessageFacade message = createAmqpMessageFacade(); Mockito.when(message.getReplyToGroupId()).thenReturn(testValue); assertNotNull(AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_REPLY_TO_GROUP_ID)); assertEquals(testValue, AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_REPLY_TO_GROUP_ID)); }
@Test public void testGetJmsAmqpTypedEncodingWithNonObjectMessage() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); assertNull(AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_TYPED_ENCODING)); }
@Test public void testGetJmsAmqpTypedEncodingWhenUsingSerializatio() throws JMSException { AmqpJmsObjectMessageFacade message = createAmqpObjectMessageFacade(); Mockito.when(message.isAmqpTypedEncoding()).thenReturn(false); assertEquals(false, AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_TYPED_ENCODING)); }
@Test public void testGetJmsAmqpTypedEncodingWhenUsingAmqpTypes() throws JMSException { AmqpJmsObjectMessageFacade message = createAmqpObjectMessageFacade(); Mockito.when(message.isAmqpTypedEncoding()).thenReturn(true); assertEquals(true, AmqpJmsMessagePropertyIntercepter.getProperty(message, JMS_AMQP_TYPED_ENCODING)); }