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.test.integration.message;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertEquals;
16  import static org.junit.Assert.assertNotNull;
17  
18  public class MessagePropertyScopesTestCase extends FunctionalTestCase {
19  
20      @Override
21      protected String getConfigResources()
22      {
23          return "org/mule/test/integration/messaging/message-property-scopes-config.xml";
24      }
25  
26      @Test
27      public void testSessionProperty() throws Exception {
28  
29          MuleClient client = new MuleClient(muleContext);
30          MuleMessage response = client.send("vm://in1", "Hello World", null);
31          assertNotNull(response);
32          String payload = response.getPayloadAsString();
33          assertNotNull(payload);
34          assertEquals("java.util.Date", payload);
35      }
36  
37      /* Test fails
38      @Test
39      public void testInvocationProperty() throws Exception {
40          
41          MuleClient client = new MuleClient();
42          MuleMessage response = client.send("vm://in2", "Hello World", null);
43          // scope = "invocation" should not propagate the property on to the next service
44          assertTrue(response.getPayload() instanceof NullPayload);
45      }
46      */
47  }