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.config.spring.parsers.endpoint;
8   
9   import org.mule.api.MuleException;
10  import org.mule.api.endpoint.EndpointURI;
11  import org.mule.api.endpoint.ImmutableEndpoint;
12  import org.mule.tck.junit4.FunctionalTestCase;
13  
14  import static org.junit.Assert.assertEquals;
15  import static org.junit.Assert.assertNotNull;
16  
17  public abstract class AbstractEndpointTestCase extends FunctionalTestCase
18  {
19  
20      public ImmutableEndpoint doTest(String name) throws MuleException
21      {
22          ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(name);
23          assertNotNull(endpoint);
24          EndpointURI uri = endpoint.getEndpointURI();
25          assertNotNull(uri);
26          assertEquals("foo", uri.getAddress());
27          assertEquals("test", uri.getScheme());
28          return endpoint;
29      }
30  
31  }