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.IsNull;
10  import org.junit.Test;
11  import org.mule.api.MuleMessage;
12  import org.mule.module.client.MuleClient;
13  import org.mule.tck.junit4.FunctionalTestCase;
14  
15  import static org.hamcrest.core.Is.is;
16  import static org.junit.Assert.assertThat;
17  
18  public class JmsObjectToMessageTransformerInResponseTestCase extends AbstractJmsFunctionalTestCase
19  {
20  
21      public static final int TIMEOUT = 3000;
22  
23      @Override
24      protected String getConfigResources()
25      {
26          return "integration/jms-object-to-message-transformer-test-case.xml";
27      }
28  
29      @Test
30      public void testObjectToMessageDoesntFail() throws Exception
31      {
32          MuleClient muleClient = new MuleClient(muleContext);
33          MuleMessage response = muleClient.send("inWithTransformers", "A message", null, TIMEOUT);
34          assertThat(response, IsNull.<Object>notNullValue());
35          assertThat(response.getPayloadAsString(), is("A message with something more"));
36      }
37  }