### Question:
AmqpJmsMessageFactory implements JmsMessageFactory { @Override public JmsTextMessage createTextMessage() throws JMSException { return createTextMessage(null); } AmqpJmsMessageFactory(AmqpConnection connection); AmqpConnection getAmqpConnection(); @Override JmsMessage createMessage(); @Override JmsTextMessage createTextMessage(); @Override JmsTextMessage createTextMessage(String payload); @Override JmsBytesMessage createBytesMessage(); @Override JmsMapMessage createMapMessage(); @Override JmsStreamMessage createStreamMessage(); @Override JmsObjectMessage createObjectMessage(); @Override JmsObjectMessage createObjectMessage(Serializable payload);  }### Answer:
@Test public void testCreateTextMessage() throws JMSException { AmqpJmsMessageFactory factory = new AmqpJmsMessageFactory(createMockAmqpConnection()); JmsTextMessage message = factory.createTextMessage(); JmsTextMessageFacade facade = (JmsTextMessageFacade) message.getFacade(); assertTrue(facade instanceof AmqpJmsTextMessageFacade); AmqpJmsTextMessageFacade amqpMessage = (AmqpJmsTextMessageFacade) facade; assertEquals(JMS_TEXT_MESSAGE, amqpMessage.getJmsMsgType()); assertNull(amqpMessage.getText()); }
@Test public void testCreateTextMessageString() throws JMSException { AmqpJmsMessageFactory factory = new AmqpJmsMessageFactory(createMockAmqpConnection()); JmsTextMessage message = factory.createTextMessage("SomeValue"); JmsTextMessageFacade facade = (JmsTextMessageFacade) message.getFacade(); assertTrue(facade instanceof AmqpJmsTextMessageFacade); AmqpJmsTextMessageFacade amqpMessage = (AmqpJmsTextMessageFacade) facade; assertEquals(JMS_TEXT_MESSAGE, amqpMessage.getJmsMsgType()); assertEquals("SomeValue", amqpMessage.getText()); }