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.http.functional;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  import org.mule.tck.junit4.rule.DynamicPort;
13  
14  import org.junit.Rule;
15  import org.junit.Test;
16  
17  import static org.junit.Assert.assertEquals;
18  import static org.junit.Assert.assertNotNull;
19  
20  public class HttpMultipleCookiesInEndpointTestCase extends FunctionalTestCase
21  {
22  
23      @Rule
24      public DynamicPort dynamicPort = new DynamicPort("port1");
25  
26      @Override
27      protected String getConfigResources()
28      {
29          return "http-multiple-cookies-on-endpoint-test.xml";
30      }
31  
32      @Test
33      public void testThatThe2CookiesAreSentAndReceivedByTheComponent() throws Exception
34      {
35          MuleClient client = new MuleClient(muleContext);
36          MuleMessage response = client.send("vm://in", "HELLO", null);
37          assertNotNull(response);
38          assertNotNull(response.getPayload());
39          assertEquals("Both Cookies Found!", response.getPayloadAsString());
40      }
41  
42  }
43  
44