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.resolvers;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  
13  import java.util.Map;
14  
15  import static org.junit.Assert.assertEquals;
16  
17  public abstract class AbstractEntryPointResolverTestCase extends FunctionalTestCase
18  {
19  
20      protected void doTest(String path, Object payload, String result) throws Exception
21      {
22          doTest(path, payload, result, null);
23      }
24  
25      protected void doTest(String path, Object payload, String result, Map properties) throws Exception
26      {
27          MuleClient client = new MuleClient(muleContext);
28          MuleMessage response = client.send("vm://" + path, payload, properties);
29          assertEquals(result, response.getPayloadAsString());
30      }
31  
32  }