### Question:
AmqpJmsMessagePropertyIntercepter { public static boolean propertyExists(AmqpJmsMessageFacade message, String name) throws JMSException { PropertyIntercepter propertyExpression = PROPERTY_INTERCEPTERS.get(name); if (propertyExpression != null) { return propertyExpression.propertyExists(message); } else { return message.applicationPropertyExists(name); } }  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 testPropertyExistsWithNonInterceptedNameCallsIntoFacade() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); assertFalse(AmqpJmsMessagePropertyIntercepter.propertyExists(message, "SomeRandomPropertyName")); Mockito.verify(message).applicationPropertyExists(Mockito.anyString()); }
@Test public void testJmsAmqpTtlIPropertExistsWhenSet() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); Mockito.when(message.hasAmqpTimeToLiveOverride()).thenReturn(true); Mockito.when(message.getAmqpTimeToLiveOverride()).thenReturn(65536L); assertTrue(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_TTL)); }
@Test public void testJmsAmqpTtlPropertExistsWhenNotSet() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); assertFalse(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_TTL)); }
@Test public void testJmsAmqpReplyToGroupIdPropertExistsWhenSet() throws JMSException { String testValue = "ReplyToGroupId"; AmqpJmsMessageFacade message = createAmqpMessageFacade(); Mockito.when(message.getReplyToGroupId()).thenReturn(testValue); assertTrue(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_REPLY_TO_GROUP_ID)); }
@Test public void testJmsAmqpReplyToGroupIdPropertExistsWhenNotSet() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); Mockito.when(message.getReplyToGroupId()).thenReturn(null); assertFalse(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_REPLY_TO_GROUP_ID)); Mockito.when(message.getReplyToGroupId()).thenReturn(""); assertFalse(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_REPLY_TO_GROUP_ID)); }
@Test public void testJmsAmqpTypedEncodingPropertExistsWhenSet() throws JMSException { AmqpJmsObjectMessageFacade message = createAmqpObjectMessageFacade(); Mockito.when(message.isAmqpTypedEncoding()).thenReturn(true); assertTrue(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_TYPED_ENCODING)); }
@Test public void testJmsAmqpTypedEncodingdPropertExistsWhenNotSet() throws JMSException { AmqpJmsObjectMessageFacade message = createAmqpObjectMessageFacade(); Mockito.when(message.isAmqpTypedEncoding()).thenReturn(false); assertFalse(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_TYPED_ENCODING)); }
@Test public void testJmsAmqpTypedEncodingdPropertExistsWhenNotAnObjectMessage() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); assertFalse(AmqpJmsMessagePropertyIntercepter.propertyExists(message, JMS_AMQP_TYPED_ENCODING)); }