@Test public void testExtractMapMessageTypeAttributes() throws JMSException { MapMessage mapMessage = mock(MapMessage.class); final Map<String, String> mockMap = new HashMap<String, String>(); mockMap.put("test-key", "test-value"); when(mapMessage.getMapNames()).thenReturn(new Enumeration<String>() { Iterator<String> iter = mockMap.keySet().iterator(); public boolean hasMoreElements() { return iter.hasNext(); } public String nextElement() { return iter.next(); } }); when(mapMessage.getObject(argThat(new BaseMatcher<String>() { public boolean matches(Object val) { return "test-key".equals(val); } public void describeTo(Description desc) { } }))).thenReturn(mockMap.get("test-key")); Operation op = new Operation(); extractMessageTypeAttributes(op, mapMessage); String type = op.get(MESSAGE_TYPE, String.class); OperationMap contentMap = op.get(MESSAGE_CONTENT_MAP, OperationMap.class); assertNotNull(contentMap); assertEquals(mockMap.size(), contentMap.size()); assertEquals(mockMap.get("test-key"), contentMap.get("test-key")); assertEquals(MessageType.MapMessage.name(), type); assertNull(op.get(MESSAGE_CONTENT)); }
static void extractMessageTypeAttributes(Operation op, Message message) throws JMSException { MessageType messageType = MessageType.getType(message); messageType.handleMessage(message, op); }
JMSPluginUtils { static void extractMessageTypeAttributes(Operation op, Message message) throws JMSException { MessageType messageType = MessageType.getType(message); messageType.handleMessage(message, op); } }
JMSPluginUtils { static void extractMessageTypeAttributes(Operation op, Message message) throws JMSException { MessageType messageType = MessageType.getType(message); messageType.handleMessage(message, op); } private  JMSPluginUtils(); }
JMSPluginUtils { static void extractMessageTypeAttributes(Operation op, Message message) throws JMSException { MessageType messageType = MessageType.getType(message); messageType.handleMessage(message, op); } private  JMSPluginUtils();  }
JMSPluginUtils { static void extractMessageTypeAttributes(Operation op, Message message) throws JMSException { MessageType messageType = MessageType.getType(message); messageType.handleMessage(message, op); } private  JMSPluginUtils();   }