@Test public void testJMSCorrelationIDClearedWhenRequested() throws JMSException { JmsMessageFacade facade = Mockito.mock(JmsMessageFacade.class); JmsMessage message = Mockito.mock(JmsMapMessage.class); Mockito.when(message.getFacade()).thenReturn(facade); JmsMessagePropertyIntercepter.clearProperties(message, true); Mockito.verify(facade, Mockito.never()).setCorrelationId(null); JmsMessagePropertyIntercepter.clearProperties(message, false); Mockito.verify(facade).setCorrelationId(null); }
public static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders) throws JMSException { for (Entry<String, PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) { if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) { continue; } entry.getValue().clearProperty(message); } message.getFacade().clearProperties(); message.setReadOnlyProperties(false); }
JmsMessagePropertyIntercepter { public static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders) throws JMSException { for (Entry<String, PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) { if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) { continue; } entry.getValue().clearProperty(message); } message.getFacade().clearProperties(); message.setReadOnlyProperties(false); } }
JmsMessagePropertyIntercepter { public static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders) throws JMSException { for (Entry<String, PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) { if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) { continue; } entry.getValue().clearProperty(message); } message.getFacade().clearProperties(); message.setReadOnlyProperties(false); }  }
JmsMessagePropertyIntercepter { public static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders) throws JMSException { for (Entry<String, PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) { if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) { continue; } entry.getValue().clearProperty(message); } message.getFacade().clearProperties(); message.setReadOnlyProperties(false); }  static Object getProperty(JmsMessage message, String name); static void setProperty(JmsMessage message, String name, Object value); static boolean propertyExists(JmsMessage message, String name); static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders); static Set<String> getAllPropertyNames(JmsMessage message); static Set<String> getPropertyNames(JmsMessage message, boolean excludeStandardJMSHeaders); }
JmsMessagePropertyIntercepter { public static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders) throws JMSException { for (Entry<String, PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) { if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) { continue; } entry.getValue().clearProperty(message); } message.getFacade().clearProperties(); message.setReadOnlyProperties(false); }  static Object getProperty(JmsMessage message, String name); static void setProperty(JmsMessage message, String name, Object value); static boolean propertyExists(JmsMessage message, String name); static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders); static Set<String> getAllPropertyNames(JmsMessage message); static Set<String> getPropertyNames(JmsMessage message, boolean excludeStandardJMSHeaders);  }