public class ServiceInterfaceStrategyTest {
private static final Log LOG = LogFactory.getLog(ServiceInterfaceStrategyTest.class);
@Test
public void testServiceInterfaceStrategyWithClient() {
ServiceInterfaceStrategy strategy = new ServiceInterfaceStrategy(CustomerService.class, true);
QName elName = strategy.findQNameForSoapActionOrType("", GetCustomersByName.class);
Assert.assertEquals("http://customerservice.example.com/", elName.getNamespaceURI());
Assert.assertEquals("getCustomersByName", elName.getLocalPart());
QName elName2 = strategy.findQNameForSoapActionOrType("getCustomersByName", GetCustomersByName.class);
Assert.assertEquals("http://customerservice.example.com/", elName2.getNamespaceURI());
Assert.assertEquals("getCustomersByName", elName2.getLocalPart());
try {
elName = strategy.findQNameForSoapActionOrType("test", Class.class);
Assert.fail();
} catch (RuntimeCamelException e) {
LOG.debug("Caught expected message: " + e.getMessage());
}
}