@Test public void testSetPropertyWithNonInterceptedNameCallsIntoFacade() throws JMSException { AmqpJmsMessageFacade message = createAmqpMessageFacade(); AmqpJmsMessagePropertyIntercepter.setProperty(message, "SomeRandomPropertyName", "Something"); Mockito.doThrow(new JMSException("Expected")).when(message).setApplicationProperty(Mockito.anyString(), Mockito.anyString()); try { AmqpJmsMessagePropertyIntercepter.setProperty(message, "SomeRandomPropertyName", "Something"); fail("Should have thrown"); } catch (JMSException ex) { assertEquals("Expected", ex.getMessage()); } }
public static void setProperty(AmqpJmsMessageFacade message, String name, Object value) throws JMSException { PropertyIntercepter propertyExpression = PROPERTY_INTERCEPTERS.get(name); if (propertyExpression != null) { propertyExpression.setProperty(message, value); } else { message.setApplicationProperty(name, value); } }
AmqpJmsMessagePropertyIntercepter { public static void setProperty(AmqpJmsMessageFacade message, String name, Object value) throws JMSException { PropertyIntercepter propertyExpression = PROPERTY_INTERCEPTERS.get(name); if (propertyExpression != null) { propertyExpression.setProperty(message, value); } else { message.setApplicationProperty(name, value); } } }
AmqpJmsMessagePropertyIntercepter { public static void setProperty(AmqpJmsMessageFacade message, String name, Object value) throws JMSException { PropertyIntercepter propertyExpression = PROPERTY_INTERCEPTERS.get(name); if (propertyExpression != null) { propertyExpression.setProperty(message, value); } else { message.setApplicationProperty(name, value); } }  }
AmqpJmsMessagePropertyIntercepter { public static void setProperty(AmqpJmsMessageFacade message, String name, Object value) throws JMSException { PropertyIntercepter propertyExpression = PROPERTY_INTERCEPTERS.get(name); if (propertyExpression != null) { propertyExpression.setProperty(message, value); } else { message.setApplicationProperty(name, 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); }
AmqpJmsMessagePropertyIntercepter { public static void setProperty(AmqpJmsMessageFacade message, String name, Object value) throws JMSException { PropertyIntercepter propertyExpression = PROPERTY_INTERCEPTERS.get(name); if (propertyExpression != null) { propertyExpression.setProperty(message, value); } else { message.setApplicationProperty(name, 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);  }