when(mockXASession.createConsumer((Destination) anyObject(), anyString())).thenReturn(messageConsumer);
when(mockXASession.createConsumer((Destination) anyObject(), anyString(), anyBoolean())).thenReturn(messageConsumer);
Queue queue = mock(Queue.class);
when(mockXASession.createQueue(anyString())).thenReturn(queue);
Topic topic = mock(Topic.class);
when(mockXASession.createTopic(anyString())).thenReturn(topic);
MockXAResource mockXAResource = new MockXAResource(null);
when(mockXASession.getXAResource()).thenReturn(mockXAResource);
Answer<Session> sessionAnswer = new Answer<Session>() {
public Session answer(InvocationOnMock invocation) throws Throwable {
Session session = mock(Session.class);