CXFServicePortBuilder implements ServicePortBuilder<T> { static void setOptionalSOAPBinding(JaxWsProxyFactoryBean factory, String binding) { if (binding != null) { factory.setBindingId(binding); } } CXFServicePortBuilder(ServicePortDescriptor<T> portDescriptor); @SuppressWarnings("unchecked") @Override T createPort(String gatewayAlias, AssertionType assertion);  }
@Test public void setsSOAP12Binding() { JaxWsProxyFactoryBean jaxWsProxyFactoryBean = mock(JaxWsProxyFactoryBean.class); CXFServicePortBuilder.setOptionalSOAPBinding(jaxWsProxyFactoryBean, SOAPBinding.SOAP12HTTP_BINDING); verify(jaxWsProxyFactoryBean).setBindingId(eq(SOAPBinding.SOAP12HTTP_BINDING)); }
@Test public void setsSOAP11Binding() { JaxWsProxyFactoryBean jaxWsProxyFactoryBean = mock(JaxWsProxyFactoryBean.class); CXFServicePortBuilder.setOptionalSOAPBinding(jaxWsProxyFactoryBean, SOAPBinding.SOAP11HTTP_BINDING); verify(jaxWsProxyFactoryBean).setBindingId(eq(SOAPBinding.SOAP11HTTP_BINDING)); }
@Test public void setBindingNotCalled() { JaxWsProxyFactoryBean jaxWsProxyFactoryBean = mock(JaxWsProxyFactoryBean.class); CXFServicePortBuilder.setOptionalSOAPBinding(jaxWsProxyFactoryBean, null); verify(jaxWsProxyFactoryBean, never()).setBindingId(any(String.class)); }