This is an automated email from the ASF dual-hosted git repository. reta pushed a commit to branch 3.6.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git
commit bb048f3554f56ac31b139ff79984f0c332abd148 Author: Andriy Redko <[email protected]> AuthorDate: Sat Jun 17 09:06:51 2023 -0400 CXF-8854: Get rid of EasyMock in cxf-rt-wsdl (#1297) (cherry picked from commit 4a48597695b211b135a35725a45d54f5c09fc715) --- rt/wsdl/pom.xml | 5 +- .../interceptors/DocLiteralInInterceptorTest.java | 111 +++++++++------------ .../factory/ReflectionServiceFactorBeanTest.java | 32 ++---- .../apache/cxf/wsdl11/ServiceWSDLBuilderTest.java | 29 +++--- .../apache/cxf/wsdl11/WSDLServiceBuilderTest.java | 74 ++++++++------ 5 files changed, 111 insertions(+), 140 deletions(-) diff --git a/rt/wsdl/pom.xml b/rt/wsdl/pom.xml index c0634c6b81..053a081638 100644 --- a/rt/wsdl/pom.xml +++ b/rt/wsdl/pom.xml @@ -56,8 +56,9 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>${cxf.mockito.version}</version> <scope>test</scope> </dependency> <dependency> diff --git a/rt/wsdl/src/test/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptorTest.java b/rt/wsdl/src/test/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptorTest.java index b91c0d098f..d0236a917a 100644 --- a/rt/wsdl/src/test/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptorTest.java +++ b/rt/wsdl/src/test/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptorTest.java @@ -51,13 +51,11 @@ import org.apache.cxf.service.model.ServiceInfo; import org.apache.cxf.staxutils.PartialXMLStreamReader; import org.apache.cxf.staxutils.StaxUtils; -import org.easymock.EasyMock; -import org.easymock.IMocksControl; -import org.junit.After; -import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; /** * Unit test for testing DocLiteralInInterceptor to use Source Data Binding @@ -66,17 +64,6 @@ import static org.junit.Assert.assertEquals; public class DocLiteralInInterceptorTest { private static final String NS = "http://cxf.apache.org/wsdl-first/types"; - protected IMocksControl control; - - @Before - public void setUp() throws Exception { - control = EasyMock.createNiceControl(); - } - - @After - public void tearDown() throws Exception { - control.verify(); - } @Test public void testUnmarshalSourceData() throws Exception { @@ -95,13 +82,13 @@ public class DocLiteralInInterceptorTest { Message m = new MessageImpl(); Exchange exchange = new ExchangeImpl(); - Service service = control.createMock(Service.class); + Service service = mock(Service.class); exchange.put(Service.class, service); - EasyMock.expect(service.getDataBinding()).andReturn(new SourceDataBinding()); - EasyMock.expect(service.size()).andReturn(0).anyTimes(); - EasyMock.expect(service.isEmpty()).andReturn(true).anyTimes(); + when(service.getDataBinding()).thenReturn(new SourceDataBinding()); + when(service.size()).thenReturn(0); + when(service.isEmpty()).thenReturn(true); - Endpoint endpoint = control.createMock(Endpoint.class); + Endpoint endpoint = mock(Endpoint.class); exchange.put(Endpoint.class, endpoint); OperationInfo operationInfo = new OperationInfo(); @@ -122,36 +109,33 @@ public class DocLiteralInInterceptorTest { BindingOperationInfo boi = new BindingOperationInfo(null, operationInfo); exchange.put(BindingOperationInfo.class, boi); - EndpointInfo endpointInfo = control.createMock(EndpointInfo.class); - BindingInfo binding = control.createMock(BindingInfo.class); - EasyMock.expect(endpoint.getEndpointInfo()).andReturn(endpointInfo).anyTimes(); - EasyMock.expect(endpointInfo.getBinding()).andReturn(binding).anyTimes(); - EasyMock.expect(binding.getProperties()).andReturn(new HashMap<String, Object>()).anyTimes(); - EasyMock.expect(endpointInfo.getProperties()).andReturn(new HashMap<String, Object>()).anyTimes(); - EasyMock.expect(endpoint.size()).andReturn(0).anyTimes(); - EasyMock.expect(endpoint.isEmpty()).andReturn(true).anyTimes(); + EndpointInfo endpointInfo = mock(EndpointInfo.class); + BindingInfo binding = mock(BindingInfo.class); + when(endpoint.getEndpointInfo()).thenReturn(endpointInfo); + when(endpointInfo.getBinding()).thenReturn(binding); + when(binding.getProperties()).thenReturn(new HashMap<String, Object>()); + when(endpointInfo.getProperties()).thenReturn(new HashMap<String, Object>()); + when(endpoint.size()).thenReturn(0); + when(endpoint.isEmpty()).thenReturn(true); - ServiceInfo serviceInfo = control.createMock(ServiceInfo.class); - EasyMock.expect(endpointInfo.getService()).andReturn(serviceInfo).anyTimes(); + ServiceInfo serviceInfo = mock(ServiceInfo.class); + when(endpointInfo.getService()).thenReturn(serviceInfo); - EasyMock.expect(serviceInfo.getName()).andReturn(new QName("http://foo.com", "service")).anyTimes(); - InterfaceInfo interfaceInfo = control.createMock(InterfaceInfo.class); - EasyMock.expect(serviceInfo.getInterface()).andReturn(interfaceInfo).anyTimes(); - EasyMock.expect(interfaceInfo.getName()) - .andReturn(new QName("http://foo.com", "interface")).anyTimes(); + when(serviceInfo.getName()).thenReturn(new QName("http://foo.com", "service")); + InterfaceInfo interfaceInfo = mock(InterfaceInfo.class); + when(serviceInfo.getInterface()).thenReturn(interfaceInfo); + when(interfaceInfo.getName()).thenReturn(new QName("http://foo.com", "interface")); - EasyMock.expect(endpointInfo.getName()).andReturn(new QName("http://foo.com", "endpoint")).anyTimes(); - EasyMock.expect(endpointInfo.getProperty("URI", URI.class)).andReturn(new URI("dummy")).anyTimes(); + when(endpointInfo.getName()).thenReturn(new QName("http://foo.com", "endpoint")); + when(endpointInfo.getProperty("URI", URI.class)).thenReturn(new URI("dummy")); List<OperationInfo> operations = new ArrayList<>(); - EasyMock.expect(interfaceInfo.getOperations()).andReturn(operations).anyTimes(); + when(interfaceInfo.getOperations()).thenReturn(operations); m.setExchange(exchange); m.put(Message.SCHEMA_VALIDATION_ENABLED, false); m.setContent(XMLStreamReader.class, reader); - control.replay(); - new DocLiteralInInterceptor().handleMessage(m); MessageContentsList params = (MessageContentsList)m.getContent(List.class); @@ -183,13 +167,13 @@ public class DocLiteralInInterceptorTest { m.put(DocLiteralInInterceptor.KEEP_PARAMETERS_WRAPPER, true); Exchange exchange = new ExchangeImpl(); - Service service = control.createMock(Service.class); + Service service = mock(Service.class); exchange.put(Service.class, service); - EasyMock.expect(service.getDataBinding()).andReturn(new SourceDataBinding()).anyTimes(); - EasyMock.expect(service.size()).andReturn(0).anyTimes(); - EasyMock.expect(service.isEmpty()).andReturn(true).anyTimes(); + when(service.getDataBinding()).thenReturn(new SourceDataBinding()); + when(service.size()).thenReturn(0); + when(service.isEmpty()).thenReturn(true); - Endpoint endpoint = control.createMock(Endpoint.class); + Endpoint endpoint = mock(Endpoint.class); exchange.put(Endpoint.class, endpoint); // wrapped @@ -209,40 +193,37 @@ public class DocLiteralInInterceptorTest { operationInfoWrapper.setInput("inputName", messageInfoWrapper); operationInfoWrapper.setUnwrappedOperation(operationInfo); - ServiceInfo serviceInfo = control.createMock(ServiceInfo.class); + ServiceInfo serviceInfo = mock(ServiceInfo.class); - EasyMock.expect(serviceInfo.getName()).andReturn(new QName("http://foo.com", "service")).anyTimes(); - InterfaceInfo interfaceInfo = control.createMock(InterfaceInfo.class); - EasyMock.expect(serviceInfo.getInterface()).andReturn(interfaceInfo).anyTimes(); - EasyMock.expect(interfaceInfo.getName()).andReturn(new QName("http://foo.com", "interface")) - .anyTimes(); + when(serviceInfo.getName()).thenReturn(new QName("http://foo.com", "service")); + InterfaceInfo interfaceInfo = mock(InterfaceInfo.class); + when(serviceInfo.getInterface()).thenReturn(interfaceInfo); + when(interfaceInfo.getName()).thenReturn(new QName("http://foo.com", "interface")); BindingInfo bindingInfo = new BindingInfo(serviceInfo, ""); BindingOperationInfo boi = new BindingOperationInfo(bindingInfo, operationInfoWrapper); exchange.put(BindingOperationInfo.class, boi); - EndpointInfo endpointInfo = control.createMock(EndpointInfo.class); - BindingInfo binding = control.createMock(BindingInfo.class); - EasyMock.expect(endpoint.getEndpointInfo()).andReturn(endpointInfo).anyTimes(); - EasyMock.expect(endpointInfo.getBinding()).andReturn(binding).anyTimes(); - EasyMock.expect(binding.getProperties()).andReturn(new HashMap<String, Object>()).anyTimes(); - EasyMock.expect(endpointInfo.getProperties()).andReturn(new HashMap<String, Object>()).anyTimes(); - EasyMock.expect(endpoint.size()).andReturn(0).anyTimes(); - EasyMock.expect(endpoint.isEmpty()).andReturn(true).anyTimes(); - EasyMock.expect(endpointInfo.getService()).andReturn(serviceInfo).anyTimes(); + EndpointInfo endpointInfo = mock(EndpointInfo.class); + BindingInfo binding = mock(BindingInfo.class); + when(endpoint.getEndpointInfo()).thenReturn(endpointInfo); + when(endpointInfo.getBinding()).thenReturn(binding); + when(binding.getProperties()).thenReturn(new HashMap<String, Object>()); + when(endpointInfo.getProperties()).thenReturn(new HashMap<String, Object>()); + when(endpoint.size()).thenReturn(0); + when(endpoint.isEmpty()).thenReturn(true); + when(endpointInfo.getService()).thenReturn(serviceInfo); - EasyMock.expect(endpointInfo.getName()).andReturn(new QName("http://foo.com", "endpoint")).anyTimes(); - EasyMock.expect(endpointInfo.getProperty("URI", URI.class)).andReturn(new URI("dummy")).anyTimes(); + when(endpointInfo.getName()).thenReturn(new QName("http://foo.com", "endpoint")); + when(endpointInfo.getProperty("URI", URI.class)).thenReturn(new URI("dummy")); List<OperationInfo> operations = new ArrayList<>(); - EasyMock.expect(interfaceInfo.getOperations()).andReturn(operations).anyTimes(); + when(interfaceInfo.getOperations()).thenReturn(operations); m.setExchange(exchange); m.put(Message.SCHEMA_VALIDATION_ENABLED, false); m.setContent(XMLStreamReader.class, reader); - control.replay(); - new DocLiteralInInterceptor().handleMessage(m); MessageContentsList params = (MessageContentsList)m.getContent(List.class); diff --git a/rt/wsdl/src/test/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactorBeanTest.java b/rt/wsdl/src/test/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactorBeanTest.java index bc0988d9a8..1c7b2cdac6 100644 --- a/rt/wsdl/src/test/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactorBeanTest.java +++ b/rt/wsdl/src/test/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactorBeanTest.java @@ -27,43 +27,27 @@ import org.apache.cxf.service.factory.FactoryBeanListenerManager; import org.apache.cxf.service.factory.ServiceConstructionException; import org.apache.cxf.wsdl.WSDLManager; -import org.easymock.EasyMock; -import org.easymock.IMocksControl; -import org.junit.After; -import org.junit.Before; import org.junit.Test; import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; /** * */ public class ReflectionServiceFactorBeanTest { - protected IMocksControl control; - - @Before - public void setUp() throws Exception { - control = EasyMock.createNiceControl(); - } - - @After - public void tearDown() throws Exception { - control.verify(); - } - @Test public void testEmptyWsdlAndNoServiceClass() throws Exception { final String dummyWsdl = "target/dummy.wsdl"; ReflectionServiceFactoryBean bean = new ReflectionServiceFactoryBean(); - Bus bus = control.createMock(Bus.class); - - WSDLManager wsdlmanager = control.createMock(WSDLManager.class); - EasyMock.expect(bus.getExtension(WSDLManager.class)).andReturn(wsdlmanager); - EasyMock.expect(wsdlmanager.getDefinition(dummyWsdl)) - .andThrow(new WSDLException("PARSER_ERROR", "Problem parsing '" + dummyWsdl + "'.")); - EasyMock.expect(bus.getExtension(FactoryBeanListenerManager.class)).andReturn(null); + Bus bus = mock(Bus.class); - control.replay(); + WSDLManager wsdlmanager = mock(WSDLManager.class); + when(bus.getExtension(WSDLManager.class)).thenReturn(wsdlmanager); + when(wsdlmanager.getDefinition(dummyWsdl)) + .thenThrow(new WSDLException("PARSER_ERROR", "Problem parsing '" + dummyWsdl + "'.")); + when(bus.getExtension(FactoryBeanListenerManager.class)).thenReturn(null); bean.setWsdlURL(dummyWsdl); bean.setServiceName(new QName("http://cxf.apache.org/hello_world_soap_http", "GreeterService")); diff --git a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java index 04d0a1bb86..8fed100a4e 100644 --- a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java +++ b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java @@ -62,8 +62,6 @@ import org.apache.cxf.wsdl.WSDLManager; import org.apache.ws.commons.schema.XmlSchema; import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.easymock.EasyMock; -import org.easymock.IMocksControl; import org.junit.After; import org.junit.Test; @@ -71,6 +69,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class ServiceWSDLBuilderTest { @@ -86,7 +86,6 @@ public class ServiceWSDLBuilderTest { private WSDLServiceBuilder wsdlServiceBuilder; private ServiceInfo serviceInfo; - private IMocksControl control; private Bus bus; private BindingFactoryManager bindingFactoryManager; private DestinationFactoryManager destinationFactoryManager; @@ -104,11 +103,10 @@ public class ServiceWSDLBuilderTest { wsdlReader.setFeature("javax.wsdl.verbose", false); def = wsdlReader.readWSDL(wsdlUrl); - control = EasyMock.createNiceControl(); - bus = control.createMock(Bus.class); - bindingFactoryManager = control.createMock(BindingFactoryManager.class); - destinationFactoryManager = control.createMock(DestinationFactoryManager.class); - destinationFactory = control.createMock(DestinationFactory.class); + bus = mock(Bus.class); + bindingFactoryManager = mock(BindingFactoryManager.class); + destinationFactoryManager = mock(DestinationFactoryManager.class); + destinationFactory = mock(DestinationFactory.class); wsdlServiceBuilder = new WSDLServiceBuilder(bus, false); for (Service serv : CastUtils.cast(def.getServices().values(), Service.class)) { @@ -117,17 +115,15 @@ public class ServiceWSDLBuilderTest { break; } } - EasyMock.expect(bus.getExtension(WSDLManager.class)).andReturn(new WSDLManagerImpl()).anyTimes(); + when(bus.getExtension(WSDLManager.class)).thenReturn(new WSDLManagerImpl()); - EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bindingFactoryManager); - EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)) - .andReturn(destinationFactoryManager); + when(bus.getExtension(BindingFactoryManager.class)).thenReturn(bindingFactoryManager); + when(bus.getExtension(DestinationFactoryManager.class)) + .thenReturn(destinationFactoryManager); - EasyMock.expect(destinationFactoryManager + when(destinationFactoryManager .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/")) - .andReturn(destinationFactory); - - control.replay(); + .thenReturn(destinationFactory); serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0); ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, serviceInfo); @@ -138,7 +134,6 @@ public class ServiceWSDLBuilderTest { @After public void tearDown() throws Exception { - control.verify(); newDef = null; } diff --git a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java index b66b921435..0a033d394e 100644 --- a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java +++ b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java @@ -67,8 +67,6 @@ import org.apache.cxf.transport.DestinationFactoryManager; import org.apache.cxf.ws.addressing.EndpointReferenceUtils; import org.apache.ws.commons.schema.XmlSchemaElement; -import org.easymock.EasyMock; -import org.easymock.IMocksControl; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -77,6 +75,10 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; public class WSDLServiceBuilderTest { // TODO: reuse the wsdl in testutils and add the parameter order into one of the wsdl @@ -99,8 +101,6 @@ public class WSDLServiceBuilderTest { private ServiceInfo serviceInfo; private List<ServiceInfo> serviceInfos; - private IMocksControl control; - private Bus bus; private BindingFactoryManager bindingFactoryManager; @@ -144,33 +144,30 @@ public class WSDLServiceBuilderTest { } private void buildService(QName endpointName) throws Exception { - control = EasyMock.createNiceControl(); - bus = control.createMock(Bus.class); - bindingFactoryManager = control.createMock(BindingFactoryManager.class); - destinationFactoryManager = control.createMock(DestinationFactoryManager.class); - DestinationFactory destinationFactory = control.createMock(DestinationFactory.class); + bus = mock(Bus.class); + bindingFactoryManager = mock(BindingFactoryManager.class); + destinationFactoryManager = mock(DestinationFactoryManager.class); + DestinationFactory destinationFactory = mock(DestinationFactory.class); WSDLServiceBuilder wsdlServiceBuilder = new WSDLServiceBuilder(bus); - EasyMock.expect(bus.getExtension(BindingFactoryManager.class)) - .andReturn(bindingFactoryManager).anyTimes(); + when(bus.getExtension(BindingFactoryManager.class)) + .thenReturn(bindingFactoryManager); - EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)) - .andReturn(destinationFactoryManager).atLeastOnce(); + when(bus.getExtension(DestinationFactoryManager.class)) + .thenReturn(destinationFactoryManager); - EasyMock.expect(destinationFactoryManager + when(destinationFactoryManager .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/")) - .andReturn(destinationFactory).anyTimes(); + .thenReturn(destinationFactory); - control.replay(); serviceInfos = wsdlServiceBuilder.buildServices(def, service, endpointName); if (!serviceInfos.isEmpty()) { serviceInfo = serviceInfos.get(0); } else { serviceInfo = null; } - } @Test @@ -186,7 +183,8 @@ public class WSDLServiceBuilderTest { public void testMultiPorttype() throws Exception { setUpWSDL(MULTIPORT_WSDL_PATH, 0); assertEquals(2, serviceInfos.size()); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -204,14 +202,16 @@ public class WSDLServiceBuilderTest { assertNotNull(ei); assertEquals("http://schemas.xmlsoap.org/wsdl/soap/", ei.getTransportId()); assertNotNull(ei.getBinding()); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test public void testInterfaceInfo() throws Exception { setUpBasic(); assertEquals("Greeter", serviceInfo.getInterface().getName().getLocalPart()); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -291,7 +291,8 @@ public class WSDLServiceBuilderTest { assertTrue(pingMe.hasOutput()); assertNull(serviceInfo.getInterface().getOperation(new QName("what ever"))); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -303,7 +304,8 @@ public class WSDLServiceBuilderTest { assertEquals(bindingInfo.getInterface().getName().getLocalPart(), "Greeter"); assertEquals(bindingInfo.getName().getLocalPart(), "Greeter_SOAPBinding"); assertEquals(bindingInfo.getName().getNamespaceURI(), "http://apache.org/hello_world_soap_http"); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -334,7 +336,8 @@ public class WSDLServiceBuilderTest { BindingOperationInfo pingMe = bindingInfo.getOperation(name); assertNotNull(pingMe); assertEquals(pingMe.getName(), name); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -392,7 +395,8 @@ public class WSDLServiceBuilderTest { elementName = fault.getFaultInfo().getMessageParts().get(0).getElementQName(); assertEquals(elementName.getLocalPart(), "faultDetail"); assertEquals(elementName.getNamespaceURI(), "http://apache.org/hello_world_soap_http/types"); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -410,7 +414,8 @@ public class WSDLServiceBuilderTest { // with schema in serviceInfo Schema schema = EndpointReferenceUtils.getSchema(serviceInfo); assertNotNull(schema); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -444,7 +449,8 @@ public class WSDLServiceBuilderTest { assertFalse("greetMe should be a Unwrapped operation ", greetMe.isUnwrappedCapable()); assertNotNull(serviceInfo.getXmlSchemaCollection()); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -486,7 +492,8 @@ public class WSDLServiceBuilderTest { assertNotNull(ele); Schema schema = EndpointReferenceUtils.getSchema(serviceInfo, null); assertNotNull(schema); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @@ -496,7 +503,8 @@ public class WSDLServiceBuilderTest { doDiffPortTypeNsImport(); setUpWSDL("/DiffPortTypeNs.wsdl", 1); doDiffPortTypeNsImport(); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } private void doDiffPortTypeNsImport() { @@ -555,7 +563,8 @@ public class WSDLServiceBuilderTest { assertEquals("in3", parts.get(0).getName().getLocalPart()); assertEquals("in1", parts.get(1).getName().getLocalPart()); assertEquals("in2", parts.get(2).getName().getLocalPart()); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/http/"); } @Test @@ -569,7 +578,8 @@ public class WSDLServiceBuilderTest { assertEquals(2, parts.size()); assertEquals("header_info", parts.get(0).getName().getLocalPart()); assertEquals("the_request", parts.get(1).getName().getLocalPart()); - control.verify(); + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } @Test @@ -637,8 +647,8 @@ public class WSDLServiceBuilderTest { assertBindingOperationMessageExtensions(boi, true, true, faultName); assertBindingOperationMessageExtensions(bi.getOperation(greetMeOpName), false, true, null); - control.verify(); - + verify(destinationFactoryManager, atLeastOnce()) + .getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"); } private void assertPortTypeOperationExtensions(OperationInfo oi, boolean expectExtensions) {
