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   
8   package org.mule.transport.http;
9   
10  import static junit.framework.Assert.assertNotNull;
11  import org.mule.api.MuleMessage;
12  import org.mule.api.client.LocalMuleClient;
13  import org.mule.tck.junit4.FunctionalTestCase;
14  import org.mule.tck.junit4.rule.DynamicPort;
15  
16  import org.junit.Rule;
17  import org.junit.Test;
18  
19  public class NullSessionHandlerTestCase extends FunctionalTestCase
20  {
21  
22      @Rule
23      public DynamicPort httpPort = new DynamicPort("httpPort");
24  
25      @Override
26      protected String getConfigResources()
27      {
28          return "null-session-handler-config.xml";
29      }
30  
31      @Test
32      public void verifiesNoMuleSessionHeader() throws Exception
33      {
34          LocalMuleClient client = muleContext.getClient();
35  
36          client.dispatch("vm://testInput", TEST_MESSAGE, null);
37          MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);
38  
39          assertNotNull("Message was filtered", response);
40      }
41  }