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