@Test public void testMappedListenerMethod() throws Exception { Map<String, String> map = new HashMap<String, String>(); map.put("foo", "handle"); map.put("bar", "notDefinedOnInterface"); this.adapter.setDefaultListenerMethod("anotherHandle"); this.adapter.setQueueOrTagToMethodName(map); this.adapter.setDelegate(this.simpleService); this.messageProperties.setConsumerQueue("foo"); this.messageProperties.setConsumerTag("bar"); this.adapter.onMessage(new Message("foo".getBytes(), this.messageProperties), null); assertEquals("handle", this.simpleService.called); this.messageProperties.setConsumerQueue("junk"); this.adapter.onMessage(new Message("foo".getBytes(), this.messageProperties), null); assertEquals("notDefinedOnInterface", this.simpleService.called); this.messageProperties.setConsumerTag("junk"); this.adapter.onMessage(new Message("foo".getBytes(), this.messageProperties), null); assertEquals("anotherHandle", this.simpleService.called); }