View Javadoc

1   /*
2    * $Id: JmsRequestReplyTestCase.java 22925 2011-09-13 08:04:12Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.transport.jms.integration;
11  
12  import org.hamcrest.core.Is;
13  import org.hamcrest.core.IsNull;
14  import org.junit.Test;
15  import org.mule.api.MuleMessage;
16  import org.mule.module.client.MuleClient;
17  import org.mule.transport.NullPayload;
18  
19  import static org.junit.Assert.assertThat;
20  
21  public class JmsRequestReplyTestCase extends AbstractJmsFunctionalTestCase {
22  
23      @Override
24      protected String getConfigResources() {
25          return "integration/jms-request-reply-config.xml";
26      }
27  
28  
29      @Test
30      public void testJmsWithRequestReply() throws Exception
31      {
32          MuleMessage result = getClient().send("vm://in4jms", "some data", null);
33          assertThat(result, IsNull.<Object>notNullValue());
34          assertThat(result.getExceptionPayload(), IsNull.<Object>nullValue());
35          assertThat(result.getPayload() instanceof NullPayload, Is.is(false));
36          assertThat(result.getPayloadAsString(), Is.is("HELLO"));
37      }
38  
39  }