View Javadoc

1   /*
2    * $Id: JmsObjectToMessageTransformerInResponseTestCase.java 23122 2011-10-06 21:32:41Z pablo.lagreca $
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  
11  package org.mule.transport.jms.integration;
12  
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.tck.junit4.FunctionalTestCase;
18  
19  import static org.hamcrest.core.Is.is;
20  import static org.junit.Assert.assertThat;
21  
22  public class JmsObjectToMessageTransformerInResponseTestCase extends AbstractJmsFunctionalTestCase
23  {
24  
25      public static final int TIMEOUT = 3000;
26  
27      @Override
28      protected String getConfigResources()
29      {
30          return "integration/jms-object-to-message-transformer-test-case.xml";
31      }
32  
33      @Test
34      public void testObjectToMessageDoesntFail() throws Exception
35      {
36          MuleClient muleClient = new MuleClient(muleContext);
37          MuleMessage response = muleClient.send("inWithTransformers", "A message", null, TIMEOUT);
38          assertThat(response, IsNull.<Object>notNullValue());
39          assertThat(response.getPayloadAsString(), is("A message with something more"));
40      }
41  }