Polish
This commit is contained in:
@@ -31,7 +31,7 @@ public abstract class AbstractWebServiceMessageFactoryTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateEmptyMessage() throws Exception {
|
||||
public void testCreateEmptyMessage() {
|
||||
|
||||
WebServiceMessage message = messageFactory.createWebServiceMessage();
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ public class MockWebServiceMessage implements FaultAwareWebServiceMessage {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(char cbuf[], int off, int len) {
|
||||
public void write(char[] cbuf, int off, int len) {
|
||||
|
||||
if (off < 0 || off > cbuf.length || len < 0 || off + len > cbuf.length || off + len < 0) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
|
||||
@@ -219,7 +219,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTest {
|
||||
Marshaller marshaller = new Marshaller() {
|
||||
|
||||
@Override
|
||||
public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
|
||||
public void marshal(Object graph, Result result) throws XmlMappingException {
|
||||
|
||||
assertThat(requestObject).isEqualTo(graph);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ public class DomPoxWebServiceTemplateIntegrationTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
|
||||
resp.sendError(sc);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SimpleFaultMessageResolverTest {
|
||||
private SimpleFaultMessageResolver resolver;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
resolver = new SimpleFaultMessageResolver();
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class WebServiceTemplateTest {
|
||||
template.setMessageSender(new WebServiceMessageSender() {
|
||||
|
||||
@Override
|
||||
public WebServiceConnection createConnection(URI uri) throws IOException {
|
||||
public WebServiceConnection createConnection(URI uri) {
|
||||
return connectionMock;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class WebServiceTemplateTest {
|
||||
template.setMessageSender(new WebServiceMessageSender() {
|
||||
|
||||
@Override
|
||||
public WebServiceConnection createConnection(URI uri) throws IOException {
|
||||
public WebServiceConnection createConnection(URI uri) {
|
||||
return connectionMock;
|
||||
}
|
||||
|
||||
@@ -347,8 +347,8 @@ public class WebServiceTemplateTest {
|
||||
when(interceptorMock2.handleRequest(isA(MessageContext.class))).thenReturn(true);
|
||||
when(interceptorMock2.handleResponse(isA(MessageContext.class))).thenReturn(true);
|
||||
when(interceptorMock1.handleResponse(isA(MessageContext.class))).thenReturn(true);
|
||||
interceptorMock2.afterCompletion(isA(MessageContext.class), (Exception) isNull());
|
||||
interceptorMock1.afterCompletion(isA(MessageContext.class), (Exception) isNull());
|
||||
interceptorMock2.afterCompletion(isA(MessageContext.class), isNull());
|
||||
interceptorMock1.afterCompletion(isA(MessageContext.class), isNull());
|
||||
|
||||
WebServiceMessageCallback requestCallback = mock(WebServiceMessageCallback.class);
|
||||
requestCallback.doWithMessage(isA(WebServiceMessage.class));
|
||||
@@ -377,7 +377,7 @@ public class WebServiceTemplateTest {
|
||||
ClientInterceptor interceptorMock2 = mock(ClientInterceptor.class);
|
||||
template.setInterceptors(new ClientInterceptor[] { interceptorMock1, interceptorMock2 });
|
||||
when(interceptorMock1.handleRequest(isA(MessageContext.class))).thenReturn(false);
|
||||
interceptorMock1.afterCompletion(isA(MessageContext.class), (Exception) isNull());
|
||||
interceptorMock1.afterCompletion(isA(MessageContext.class), isNull());
|
||||
|
||||
WebServiceMessageCallback requestCallback = mock(WebServiceMessageCallback.class);
|
||||
requestCallback.doWithMessage(messageContext.getRequest());
|
||||
@@ -401,7 +401,7 @@ public class WebServiceTemplateTest {
|
||||
template.setInterceptors(new ClientInterceptor[] { interceptorMock1, interceptorMock2 });
|
||||
when(interceptorMock1.handleRequest(isA(MessageContext.class))).thenReturn(false);
|
||||
when(interceptorMock1.handleResponse(isA(MessageContext.class))).thenReturn(true);
|
||||
interceptorMock1.afterCompletion(isA(MessageContext.class), (Exception) isNull());
|
||||
interceptorMock1.afterCompletion(isA(MessageContext.class), isNull());
|
||||
|
||||
WebServiceMessageCallback requestCallback = mock(WebServiceMessageCallback.class);
|
||||
requestCallback.doWithMessage(messageContext.getRequest());
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Wsdl11DestinationProviderTest {
|
||||
private Wsdl11DestinationProvider provider;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
provider = new Wsdl11DestinationProvider();
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ public class PayloadValidatingInterceptorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonExistingSchema() throws Exception {
|
||||
public void testNonExistingSchema() {
|
||||
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> {
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class AnnotationDrivenBeanDefinitionParserTest {
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
applicationContext = new ClassPathXmlApplicationContext("annotationDrivenBeanDefinitionParserTest.xml",
|
||||
getClass());
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class InterceptorsBeanDefinitionParserTest {
|
||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||
"interceptorsBeanDefinitionParserOrderTest.xml", getClass());
|
||||
|
||||
List<DelegatingSmartEndpointInterceptor> interceptors = new ArrayList<DelegatingSmartEndpointInterceptor>(
|
||||
List<DelegatingSmartEndpointInterceptor> interceptors = new ArrayList<>(
|
||||
applicationContext.getBeansOfType(DelegatingSmartEndpointInterceptor.class).values());
|
||||
|
||||
assertThat(interceptors).hasSize(6);
|
||||
@@ -75,7 +75,7 @@ public class InterceptorsBeanDefinitionParserTest {
|
||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||
"interceptorsBeanDefinitionParserInjectionTest.xml", getClass());
|
||||
|
||||
List<DelegatingSmartEndpointInterceptor> interceptors = new ArrayList<DelegatingSmartEndpointInterceptor>(
|
||||
List<DelegatingSmartEndpointInterceptor> interceptors = new ArrayList<>(
|
||||
applicationContext.getBeansOfType(DelegatingSmartEndpointInterceptor.class).values());
|
||||
|
||||
assertThat(interceptors).hasSize(1);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class WebServicesNamespaceHandlerTigerTest {
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
applicationContext = new ClassPathXmlApplicationContext("webServicesNamespaceHandlerTest-tiger.xml",
|
||||
getClass());
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class WsdlBeanDefinitionParserTest {
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
applicationContext = new ClassPathXmlApplicationContext("wsdlBeanDefinitionParserTest.xml", getClass());
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DefaultWsConfigurationTest {
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
|
||||
applicationContext.register(TestConfig.class);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class WsConfigurationSupportTest {
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
|
||||
applicationContext.register(TestConfig.class);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class WsConfigurerAdapterTest {
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
|
||||
applicationContext.register(TestConfig.class);
|
||||
@@ -131,7 +131,7 @@ public class WsConfigurerAdapterTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception {
|
||||
public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -145,8 +145,7 @@ public class WsConfigurerAdapterTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue)
|
||||
throws Exception {
|
||||
public void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DefaultMessageContextTest {
|
||||
private WebServiceMessage request;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
factoryMock = createMock(WebServiceMessageFactory.class);
|
||||
request = new MockWebServiceMessage();
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.ws.WebServiceMessageFactory;
|
||||
public class DomPoxMessageFactoryTest extends AbstractWebServiceMessageFactoryTest {
|
||||
|
||||
@Override
|
||||
protected WebServiceMessageFactory createMessageFactory() throws Exception {
|
||||
protected WebServiceMessageFactory createMessageFactory() {
|
||||
return new DomPoxMessageFactory();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class MessageDispatcherTest {
|
||||
private WebServiceMessageFactory factoryMock;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
dispatcher = new MessageDispatcher();
|
||||
factoryMock = createMock(WebServiceMessageFactory.class);
|
||||
@@ -395,7 +395,7 @@ public class MessageDispatcherTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoEndpointFound() throws Exception {
|
||||
public void testNoEndpointFound() {
|
||||
|
||||
dispatcher.setEndpointMappings(Collections.emptyList());
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Dom4jPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractDom4jPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) {
|
||||
|
||||
assertThat(requestElement).isNotNull();
|
||||
assertThat(responseDocument).isNotNull();
|
||||
@@ -47,7 +47,7 @@ public class Dom4jPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractDom4jPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -59,7 +59,7 @@ public class Dom4jPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractDom4jPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) {
|
||||
|
||||
assertThat(requestElement).isNull();
|
||||
return null;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class DomPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractDomPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement, Document document) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement, Document document) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -41,7 +41,7 @@ public class DomPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractDomPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) {
|
||||
|
||||
assertThat(requestElement).isNotNull();
|
||||
assertThat(responseDocument).isNotNull();
|
||||
@@ -59,7 +59,7 @@ public class DomPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractDomPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement, Document responseDocument) {
|
||||
|
||||
assertThat(requestElement).isNull();
|
||||
return null;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class EndpointExceptionResolverTest {
|
||||
};
|
||||
|
||||
exceptionResolver.setMappedEndpoints(Collections.singleton(this));
|
||||
methodEndpoint = new MethodEndpoint(this, getClass().getMethod("emptyMethod", new Class[0]));
|
||||
methodEndpoint = new MethodEndpoint(this, getClass().getMethod("emptyMethod"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -29,7 +29,7 @@ public class JDomPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractJDomPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -41,7 +41,7 @@ public class JDomPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractJDomPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement) {
|
||||
|
||||
assertThat(requestElement).isNotNull();
|
||||
assertThat(requestElement.getName()).isEqualTo(REQUEST_ELEMENT);
|
||||
@@ -58,7 +58,7 @@ public class JDomPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractJDomPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement) {
|
||||
|
||||
assertThat(requestElement).isNull();
|
||||
return null;
|
||||
|
||||
@@ -116,7 +116,7 @@ public class MarshallingPayloadEndpointTest {
|
||||
AbstractMarshallingPayloadEndpoint endpoint = new AbstractMarshallingPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Object invokeInternal(Object requestObject) throws Exception {
|
||||
protected Object invokeInternal(Object requestObject) {
|
||||
|
||||
assertThat(requestObject).isEqualTo(42L);
|
||||
return "result";
|
||||
@@ -174,7 +174,7 @@ public class MarshallingPayloadEndpointTest {
|
||||
AbstractMarshallingPayloadEndpoint endpoint = new AbstractMarshallingPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Object invokeInternal(Object requestObject) throws Exception {
|
||||
protected Object invokeInternal(Object requestObject) {
|
||||
|
||||
assertThat(requestObject).isEqualTo(42L);
|
||||
return null;
|
||||
@@ -201,7 +201,7 @@ public class MarshallingPayloadEndpointTest {
|
||||
AbstractMarshallingPayloadEndpoint endpoint = new AbstractMarshallingPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Object invokeInternal(Object requestObject) throws Exception {
|
||||
protected Object invokeInternal(Object requestObject) {
|
||||
|
||||
assertThat(requestObject).isNull();
|
||||
return null;
|
||||
@@ -239,7 +239,7 @@ public class MarshallingPayloadEndpointTest {
|
||||
AbstractMarshallingPayloadEndpoint endpoint = new AbstractMarshallingPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Object invokeInternal(Object requestObject) throws Exception {
|
||||
protected Object invokeInternal(Object requestObject) {
|
||||
|
||||
assertThat(requestObject).isEqualTo(42L);
|
||||
return "result";
|
||||
@@ -261,12 +261,12 @@ public class MarshallingPayloadEndpointTest {
|
||||
private static class SimpleMarshaller implements Marshaller, Unmarshaller {
|
||||
|
||||
@Override
|
||||
public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
|
||||
public void marshal(Object graph, Result result) throws XmlMappingException {
|
||||
fail("Not expected");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object unmarshal(Source source) throws XmlMappingException, IOException {
|
||||
public Object unmarshal(Source source) throws XmlMappingException {
|
||||
fail("Not expected");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ public class MethodEndpointTest {
|
||||
@Test
|
||||
public void testEquals() throws Exception {
|
||||
|
||||
assertThat(endpoint).isEqualTo(endpoint);
|
||||
assertThat(endpoint).isEqualTo(new MethodEndpoint(this, method));
|
||||
|
||||
Method otherMethod = getClass().getMethod("testEquals");
|
||||
|
||||
@@ -58,7 +58,7 @@ public class XomPayloadEndpointTest extends AbstractPayloadEndpointTest {
|
||||
return new AbstractXomPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Element invokeInternal(Element requestElement) throws Exception {
|
||||
protected Element invokeInternal(Element requestElement) {
|
||||
|
||||
assertThat(requestElement).isNull();
|
||||
return null;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testNoResponse() throws Exception {
|
||||
|
||||
Method noResponse = getClass().getMethod("noResponse", new Class[] { MyType.class });
|
||||
Method noResponse = getClass().getMethod("noResponse", MyType.class);
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
|
||||
expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(new MyType());
|
||||
|
||||
@@ -90,7 +90,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
|
||||
MockWebServiceMessage request = new MockWebServiceMessage();
|
||||
messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
|
||||
Method noResponse = getClass().getMethod("noResponse", new Class[] { MyType.class });
|
||||
Method noResponse = getClass().getMethod("noResponse", MyType.class);
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
|
||||
|
||||
replay(marshallerMock, unmarshallerMock);
|
||||
@@ -106,7 +106,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testResponse() throws Exception {
|
||||
|
||||
Method response = getClass().getMethod("response", new Class[] { MyType.class });
|
||||
Method response = getClass().getMethod("response", MyType.class);
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, response);
|
||||
expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(new MyType());
|
||||
marshallerMock.marshal(isA(MyType.class), isA(Result.class));
|
||||
@@ -125,7 +125,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testSupportedNoResponse() throws NoSuchMethodException {
|
||||
|
||||
Method noResponse = getClass().getMethod("noResponse", new Class[] { MyType.class });
|
||||
Method noResponse = getClass().getMethod("noResponse", MyType.class);
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
|
||||
expect(unmarshallerMock.supports(MyType.class)).andReturn(true);
|
||||
|
||||
@@ -139,7 +139,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testSupportedResponse() throws NoSuchMethodException {
|
||||
|
||||
Method response = getClass().getMethod("response", new Class[] { MyType.class });
|
||||
Method response = getClass().getMethod("response", MyType.class);
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, response);
|
||||
expect(unmarshallerMock.supports(MyType.class)).andReturn(true);
|
||||
expect(marshallerMock.supports(MyType.class)).andReturn(true);
|
||||
@@ -154,8 +154,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
|
||||
|
||||
Method unsupported = getClass().getMethod("unsupportedMultipleParams",
|
||||
new Class[] { String.class, String.class });
|
||||
Method unsupported = getClass().getMethod("unsupportedMultipleParams", String.class, String.class);
|
||||
|
||||
replay(marshallerMock, unmarshallerMock);
|
||||
|
||||
@@ -167,7 +166,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testUnsupportedMethodWrongParam() throws NoSuchMethodException {
|
||||
|
||||
Method unsupported = getClass().getMethod("unsupportedWrongParam", new Class[] { String.class });
|
||||
Method unsupported = getClass().getMethod("unsupportedWrongParam", String.class);
|
||||
expect(unmarshallerMock.supports(String.class)).andReturn(false);
|
||||
expect(marshallerMock.supports(String.class)).andReturn(true);
|
||||
|
||||
@@ -181,7 +180,7 @@ public class MarshallingMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testUnsupportedMethodWrongReturnType() throws NoSuchMethodException {
|
||||
|
||||
Method unsupported = getClass().getMethod("unsupportedWrongParam", new Class[] { String.class });
|
||||
Method unsupported = getClass().getMethod("unsupportedWrongParam", String.class);
|
||||
expect(marshallerMock.supports(String.class)).andReturn(false);
|
||||
|
||||
replay(marshallerMock, unmarshallerMock);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class MessageEndpointAdapterTest {
|
||||
private MessageEndpoint endpointMock;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
adapter = new MessageEndpointAdapter();
|
||||
endpointMock = createMock(MessageEndpoint.class);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MessageMethodEndpointAdapterTest {
|
||||
private MessageContext messageContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
adapter = new MessageMethodEndpointAdapter();
|
||||
messageContext = new DefaultMessageContext(new MockWebServiceMessageFactory());
|
||||
}
|
||||
@@ -44,30 +44,28 @@ public class MessageMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testSupported() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "supported", new Class[] { MessageContext.class });
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "supported", MessageContext.class);
|
||||
assertThat(adapter.supportsInternal(methodEndpoint)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
|
||||
|
||||
assertThat(adapter.supportsInternal(new MethodEndpoint(this, "unsupportedMultipleParams",
|
||||
new Class[] { MessageContext.class, MessageContext.class })))
|
||||
assertThat(adapter.supportsInternal(
|
||||
new MethodEndpoint(this, "unsupportedMultipleParams", MessageContext.class, MessageContext.class)))
|
||||
.isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedMethodWrongParam() throws NoSuchMethodException {
|
||||
|
||||
assertThat(adapter
|
||||
.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[] { String.class })))
|
||||
.isFalse();
|
||||
assertThat(adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", String.class))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvokeSupported() throws Exception {
|
||||
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "supported", new Class[] { MessageContext.class });
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "supported", MessageContext.class);
|
||||
|
||||
assertThat(supportedInvoked).isFalse();
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PayloadEndpointAdapterTest {
|
||||
private PayloadEndpoint endpointMock;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
adapter = new PayloadEndpointAdapter();
|
||||
endpointMock = createMock(PayloadEndpoint.class);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PayloadMethodEndpointAdapterTest {
|
||||
private MessageContext messageContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
adapter = new PayloadMethodEndpointAdapter();
|
||||
messageContext = new DefaultMessageContext(new MockWebServiceMessageFactory());
|
||||
@@ -53,45 +53,42 @@ public class PayloadMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testSupportedNoResponse() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "noResponse", new Class[] { DOMSource.class });
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "noResponse", DOMSource.class);
|
||||
assertThat(adapter.supportsInternal(methodEndpoint)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportedResponse() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "response", new Class[] { StreamSource.class });
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "response", StreamSource.class);
|
||||
assertThat(adapter.supportsInternal(methodEndpoint)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
|
||||
|
||||
assertThat(adapter.supportsInternal(
|
||||
new MethodEndpoint(this, "unsupportedMultipleParams", new Class[] { Source.class, Source.class })))
|
||||
assertThat(adapter
|
||||
.supportsInternal(new MethodEndpoint(this, "unsupportedMultipleParams", Source.class, Source.class)))
|
||||
.isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedMethodWrongReturnType() throws NoSuchMethodException {
|
||||
|
||||
assertThat(adapter
|
||||
.supportsInternal(new MethodEndpoint(this, "unsupportedWrongReturnType", new Class[] { Source.class })))
|
||||
assertThat(adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongReturnType", Source.class)))
|
||||
.isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedMethodWrongParam() throws NoSuchMethodException {
|
||||
|
||||
assertThat(adapter
|
||||
.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[] { String.class })))
|
||||
.isFalse();
|
||||
assertThat(adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", String.class))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoResponse() throws Exception {
|
||||
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "noResponse", new Class[] { DOMSource.class });
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "noResponse", DOMSource.class);
|
||||
|
||||
assertThat(noResponseInvoked).isFalse();
|
||||
|
||||
@@ -105,7 +102,7 @@ public class PayloadMethodEndpointAdapterTest {
|
||||
|
||||
WebServiceMessage request = new MockWebServiceMessage("<request/>");
|
||||
messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "response", new Class[] { StreamSource.class });
|
||||
MethodEndpoint methodEndpoint = new MethodEndpoint(this, "response", StreamSource.class);
|
||||
|
||||
assertThat(responseInvoked).isFalse();
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testUnsupportedInvalidParam() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidParamType", new Class[] { Integer.TYPE });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidParamType", Integer.TYPE);
|
||||
|
||||
assertThat(adapter.supports(endpoint)).isFalse();
|
||||
}
|
||||
@@ -79,45 +79,43 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
|
||||
@Test
|
||||
public void testUnsupportedInvalidReturnType() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidReturnType",
|
||||
new Class[] { String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidReturnType", String.class);
|
||||
assertThat(adapter.supports(endpoint)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedInvalidParams() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidParams",
|
||||
new Class[] { String.class, String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidParams", String.class, String.class);
|
||||
assertThat(adapter.supports(endpoint)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportedTypes() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedTypes",
|
||||
new Class[] { Boolean.TYPE, Double.TYPE, Node.class, NodeList.class, String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedTypes", Boolean.TYPE, Double.TYPE, Node.class,
|
||||
NodeList.class, String.class);
|
||||
assertThat(adapter.supports(endpoint)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportsStringSource() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedStringSource", new Class[] { String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedStringSource", String.class);
|
||||
assertThat(adapter.supports(endpoint)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportsSource() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedSource", new Class[] { String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedSource", String.class);
|
||||
assertThat(adapter.supports(endpoint)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportsVoid() throws NoSuchMethodException {
|
||||
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedVoid", new Class[] { String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedVoid", String.class);
|
||||
assertThat(adapter.supports(endpoint)).isTrue();
|
||||
}
|
||||
|
||||
@@ -130,8 +128,8 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
|
||||
replay(messageMock, factoryMock);
|
||||
|
||||
MessageContext messageContext = new DefaultMessageContext(messageMock, factoryMock);
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedTypes",
|
||||
new Class[] { Boolean.TYPE, Double.TYPE, Node.class, NodeList.class, String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedTypes", Boolean.TYPE, Double.TYPE, Node.class,
|
||||
NodeList.class, String.class);
|
||||
adapter.invoke(messageContext, endpoint);
|
||||
|
||||
assertThat(supportedTypesInvoked).isTrue();
|
||||
@@ -151,7 +149,7 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
|
||||
replay(requestMock, responseMock, factoryMock);
|
||||
|
||||
MessageContext messageContext = new DefaultMessageContext(requestMock, factoryMock);
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedSource", new Class[] { String.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedSource", String.class);
|
||||
adapter.invoke(messageContext, endpoint);
|
||||
|
||||
assertThat(supportedSourceInvoked).isTrue();
|
||||
@@ -185,13 +183,13 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
|
||||
|
||||
replay(requestMock, factoryMock);
|
||||
|
||||
Map<String, String> namespaces = new HashMap<String, String>();
|
||||
Map<String, String> namespaces = new HashMap<>();
|
||||
namespaces.put("root", rootNamespace);
|
||||
namespaces.put("child", childNamespace);
|
||||
adapter.setNamespaces(namespaces);
|
||||
|
||||
MessageContext messageContext = new DefaultMessageContext(requestMock, factoryMock);
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "namespaces", new Class[] { Node.class });
|
||||
MethodEndpoint endpoint = new MethodEndpoint(this, "namespaces", Node.class);
|
||||
adapter.invoke(messageContext, endpoint);
|
||||
|
||||
assertThat(namespacesInvoked).isTrue();
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SourcePayloadMethodProcessorTest extends AbstractPayloadMethodProce
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object getReturnValue(MethodParameter returnType) throws Exception {
|
||||
protected Object getReturnValue(MethodParameter returnType) {
|
||||
return new StringSource(XML);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class EndpointMappingTest {
|
||||
private MessageContext messageContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
messageContext = new DefaultMessageContext(new MockWebServiceMessageFactory());
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class EndpointMappingTest {
|
||||
Object defaultEndpoint = new Object();
|
||||
AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
|
||||
@Override
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) throws Exception {
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) {
|
||||
assertThat(givenRequest).isEqualTo(messageContext);
|
||||
return null;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class EndpointMappingTest {
|
||||
final Object endpoint = new Object();
|
||||
AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
|
||||
@Override
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) throws Exception {
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) {
|
||||
assertThat(givenRequest).isEqualTo(messageContext);
|
||||
return endpoint;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class EndpointMappingTest {
|
||||
EndpointInterceptor interceptor = new EndpointInterceptorAdapter();
|
||||
AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
|
||||
@Override
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) throws Exception {
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) {
|
||||
assertThat(givenRequest).isEqualTo(messageContext);
|
||||
return endpoint;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class EndpointMappingTest {
|
||||
EndpointInterceptor interceptor = new EndpointInterceptorAdapter();
|
||||
AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
|
||||
@Override
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) throws Exception {
|
||||
protected Object getEndpointInternal(MessageContext givenRequest) {
|
||||
assertThat(givenRequest).isEqualTo(messageContext);
|
||||
return endpoint;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class EndpointMappingTest {
|
||||
AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
|
||||
|
||||
@Override
|
||||
protected Object getEndpointInternal(MessageContext message) throws Exception {
|
||||
protected Object getEndpointInternal(MessageContext message) {
|
||||
assertThat(message).isEqualTo(messageContext);
|
||||
return "endpoint";
|
||||
}
|
||||
@@ -154,7 +154,7 @@ public class EndpointMappingTest {
|
||||
AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
|
||||
|
||||
@Override
|
||||
protected Object getEndpointInternal(MessageContext message) throws Exception {
|
||||
protected Object getEndpointInternal(MessageContext message) {
|
||||
assertThat(message).isEqualTo(messageContext);
|
||||
return "noSuchBean";
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class EndpointMappingTest {
|
||||
AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
|
||||
|
||||
@Override
|
||||
protected Object getEndpointInternal(MessageContext message) throws Exception {
|
||||
protected Object getEndpointInternal(MessageContext message) {
|
||||
assertThat(message).isEqualTo(messageContext);
|
||||
return "endpoint";
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class MapBasedSoapEndpointMappingTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
|
||||
protected String getLookupKeyForMessage(MessageContext messageContext) {
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ public class PayloadRootAnnotationMethodEndpointMappingTest {
|
||||
|
||||
MessageDispatcher messageDispatcher = new SoapMessageDispatcher();
|
||||
messageDispatcher.setApplicationContext(applicationContext);
|
||||
messageDispatcher.setEndpointMappings(Collections.<EndpointMapping>singletonList(mapping));
|
||||
messageDispatcher.setEndpointAdapters(Collections.<EndpointAdapter>singletonList(adapter));
|
||||
messageDispatcher.setEndpointMappings(Collections.singletonList(mapping));
|
||||
messageDispatcher.setEndpointAdapters(Collections.singletonList(adapter));
|
||||
|
||||
messageDispatcher.receive(messageContext);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PayloadRootQNameEndpointMappingTest {
|
||||
private PayloadRootQNameEndpointMapping mapping;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
mapping = new PayloadRootQNameEndpointMapping();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class UriEndpointMappingTest {
|
||||
private MessageContext context;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
mapping = new UriEndpointMapping();
|
||||
context = new DefaultMessageContext(new MockWebServiceMessageFactory());
|
||||
|
||||
@@ -31,7 +31,7 @@ public class XPathPayloadEndpointMappingTest {
|
||||
private XPathPayloadEndpointMapping mapping;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
mapping = new XPathPayloadEndpointMapping();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class XmlRootElementEndpointMappingTest {
|
||||
private XmlRootElementEndpointMapping mapping;
|
||||
|
||||
@BeforeEach
|
||||
public void createMapping() throws NoSuchMethodException {
|
||||
public void createMapping() {
|
||||
mapping = new XmlRootElementEndpointMapping();
|
||||
}
|
||||
|
||||
|
||||
@@ -109,12 +109,10 @@ public abstract class AbstractSoapMessageTest extends AbstractMimeMessageTest {
|
||||
@Test
|
||||
public void testSetStreamingPayload() throws Exception {
|
||||
|
||||
if (!(soapMessage instanceof StreamingWebServiceMessage)) {
|
||||
if (!(soapMessage instanceof StreamingWebServiceMessage streamingMessage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
StreamingWebServiceMessage streamingMessage = (StreamingWebServiceMessage) soapMessage;
|
||||
|
||||
final QName name = new QName("http://springframework.org", "root", "");
|
||||
|
||||
streamingMessage.setStreamingPayload(new StreamingPayload() {
|
||||
@@ -146,7 +144,7 @@ public abstract class AbstractSoapMessageTest extends AbstractMimeMessageTest {
|
||||
protected abstract Resource[] getSoapSchemas();
|
||||
|
||||
@Test
|
||||
public abstract void testGetVersion() throws Exception;
|
||||
public abstract void testGetVersion();
|
||||
|
||||
@Test
|
||||
public abstract void testWriteToTransportOutputStream() throws Exception;
|
||||
|
||||
@@ -46,14 +46,10 @@ public abstract class AbstractWsAddressingTest {
|
||||
mimeHeaders.addHeader("Content-Type", " application/soap+xml");
|
||||
InputStream is = AbstractWsAddressingTest.class.getResourceAsStream(fileName);
|
||||
|
||||
assertThat(is).isNotNull();
|
||||
|
||||
try {
|
||||
try (is) {
|
||||
assertThat(is).isNotNull();
|
||||
return new SaajSoapMessage(messageFactory.createMessage(mimeHeaders, is));
|
||||
}
|
||||
finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
protected void assertXMLSimilar(SaajSoapMessage expected, SaajSoapMessage result) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class AddressingInterceptor200408Test extends AbstractAddressingIntercept
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testNoneReplyTo() throws Exception {
|
||||
public void testNoneReplyTo() {
|
||||
// This version of the spec does not have none addresses
|
||||
}
|
||||
|
||||
|
||||
@@ -91,15 +91,11 @@ public class AnnotationActionMethodEndpointMappingTest {
|
||||
mimeHeaders.addHeader("Content-Type", " application/soap+xml");
|
||||
InputStream is = getClass().getResourceAsStream("valid.xml");
|
||||
|
||||
assertThat(is).isNotNull();
|
||||
|
||||
try {
|
||||
try (is) {
|
||||
assertThat(is).isNotNull();
|
||||
SaajSoapMessage message = new SaajSoapMessage(messageFactory.createMessage(mimeHeaders, is));
|
||||
return new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));
|
||||
}
|
||||
finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Endpoint
|
||||
|
||||
@@ -54,7 +54,7 @@ public class SoapMessageDispatcherTest {
|
||||
private SoapEndpointInterceptor interceptorMock;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
interceptorMock = createMock(SoapEndpointInterceptor.class);
|
||||
dispatcher = new SoapMessageDispatcher();
|
||||
|
||||
@@ -128,7 +128,7 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
|
||||
AbstractFaultCreatingValidatingMarshallingPayloadEndpoint endpoint = new AbstractFaultCreatingValidatingMarshallingPayloadEndpoint() {
|
||||
|
||||
@Override
|
||||
protected Object invokeInternal(Object requestObject) throws Exception {
|
||||
protected Object invokeInternal(Object requestObject) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -210,7 +210,7 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object unmarshal(Source source) throws XmlMappingException, IOException {
|
||||
public Object unmarshal(Source source) throws XmlMappingException {
|
||||
return person;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
|
||||
public void marshal(Object graph, Result result) throws XmlMappingException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SimpleSoapExceptionResolverTest {
|
||||
private WebServiceMessageFactory factoryMock;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
exceptionResolver = new SimpleSoapExceptionResolver();
|
||||
factoryMock = createMock(WebServiceMessageFactory.class);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SoapFaultAnnotationExceptionResolverTest {
|
||||
private SoapFaultAnnotationExceptionResolver resolver;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
resolver = new SoapFaultAnnotationExceptionResolver();
|
||||
}
|
||||
|
||||
@@ -240,18 +240,18 @@ public class SoapFaultAnnotationExceptionResolverTest {
|
||||
|
||||
@SoapFault(faultCode = FaultCode.CLIENT, faultStringOrReason = "Client error")
|
||||
@SuppressWarnings("serial")
|
||||
public class MyClientException extends Exception {
|
||||
public static class MyClientException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MySubClientException extends MyClientException {
|
||||
public static class MySubClientException extends MyClientException {
|
||||
|
||||
}
|
||||
|
||||
@SoapFault(faultCode = FaultCode.CLIENT)
|
||||
@SuppressWarnings("serial")
|
||||
public class NoStringOrReasonException extends Exception {
|
||||
public static class NoStringOrReasonException extends Exception {
|
||||
|
||||
public NoStringOrReasonException(String message) {
|
||||
super(message);
|
||||
@@ -261,31 +261,31 @@ public class SoapFaultAnnotationExceptionResolverTest {
|
||||
|
||||
@SoapFault(faultCode = FaultCode.SENDER, faultStringOrReason = "Sender error")
|
||||
@SuppressWarnings("serial")
|
||||
public class MySenderException extends Exception {
|
||||
public static class MySenderException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
@SoapFault(faultCode = FaultCode.SERVER, faultStringOrReason = "Server error")
|
||||
@SuppressWarnings("serial")
|
||||
public class MyServerException extends Exception {
|
||||
public static class MyServerException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
@SoapFault(faultCode = FaultCode.RECEIVER, faultStringOrReason = "Receiver error")
|
||||
@SuppressWarnings("serial")
|
||||
public class MyReceiverException extends Exception {
|
||||
public static class MyReceiverException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
@SoapFault(faultCode = FaultCode.CUSTOM, customFaultCode = "{http://springframework.org/spring-ws}Fault",
|
||||
faultStringOrReason = "MyCustomException thrown", locale = "nl")
|
||||
@SuppressWarnings("serial")
|
||||
public class MyCustomException extends Exception {
|
||||
public static class MyCustomException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class NonAnnotatedException extends Exception {
|
||||
public static class NonAnnotatedException extends Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SoapFaultDefinitionEditorTest {
|
||||
private SoapFaultDefinitionEditor editor;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
editor = new SoapFaultDefinitionEditor();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SoapFaultMappingExceptionResolverTest {
|
||||
private SoapFaultMappingExceptionResolver resolver;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
resolver = new SoapFaultMappingExceptionResolver();
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public class SoapHeaderElementMethodArgumentResolverTest extends AbstractMethodA
|
||||
|
||||
assertThat(List.class).isAssignableFrom(result.getClass());
|
||||
|
||||
List<SoapHeaderElement> elements = (List) result;
|
||||
List<SoapHeaderElement> elements = (List<SoapHeaderElement>) result;
|
||||
|
||||
assertThat(elements.size()).isGreaterThan(1);
|
||||
|
||||
|
||||
@@ -344,13 +344,13 @@ public class PayloadValidatingInterceptorTest {
|
||||
return new SAXParseException[0];
|
||||
}
|
||||
|
||||
public void warning(SAXParseException exception) throws SAXException {
|
||||
public void warning(SAXParseException exception) {
|
||||
}
|
||||
|
||||
public void error(SAXParseException exception) throws SAXException {
|
||||
public void error(SAXParseException exception) {
|
||||
}
|
||||
|
||||
public void fatalError(SAXParseException exception) throws SAXException {
|
||||
public void fatalError(SAXParseException exception) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DelegatingSoapEndpointMappingTest {
|
||||
private EndpointMapping mock;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
endpointMapping = new DelegatingSoapEndpointMapping();
|
||||
mock = createMock(EndpointMapping.class);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SoapActionAnnotationMethodEndpointMappingTest {
|
||||
private StaticApplicationContext applicationContext;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
applicationContext = new StaticApplicationContext();
|
||||
applicationContext.registerSingleton("mapping", SoapActionAnnotationMethodEndpointMapping.class);
|
||||
@@ -67,7 +67,7 @@ public class SoapActionAnnotationMethodEndpointMappingTest {
|
||||
|
||||
assertThat(chain).isNotNull();
|
||||
|
||||
Method doIt = MyEndpoint.class.getMethod("doIt", new Class[0]);
|
||||
Method doIt = MyEndpoint.class.getMethod("doIt");
|
||||
MethodEndpoint expected = new MethodEndpoint("endpoint", applicationContext, doIt);
|
||||
|
||||
assertThat(chain.getEndpoint()).isEqualTo(expected);
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class AbstractSoap11MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageNoAttachment() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap11MessageFactoryTest.class.getResourceAsStream("soap11.xml");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type", "text/xml");
|
||||
String soapAction = "\"http://springframework.org/spring-ws/Action\"";
|
||||
headers.put("SOAPAction", soapAction);
|
||||
@@ -73,7 +73,7 @@ public abstract class AbstractSoap11MessageFactoryTest extends AbstractSoapMessa
|
||||
public void doTestCreateSoapMessageIllFormedXml() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap11MessageFactoryTest.class.getResourceAsStream("soap11-ill-formed.xml");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type", "text/xml");
|
||||
TransportInputStream tis = new MockTransportInputStream(is, headers);
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class AbstractSoap11MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageSwA() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap11MessageFactoryTest.class.getResourceAsStream("soap11-attachment.bin");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type",
|
||||
"multipart/related;" + "type=\"text/xml\";" + "boundary=\"----=_Part_0_11416420.1149699787554\"");
|
||||
TransportInputStream tis = new MockTransportInputStream(is, headers);
|
||||
@@ -112,7 +112,7 @@ public abstract class AbstractSoap11MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageMtom() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap11MessageFactoryTest.class.getResourceAsStream("soap11-mtom.bin");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type",
|
||||
"multipart/related;" + "start-info=\"text/xml\";" + "type=\"application/xop+xml\";"
|
||||
+ "start=\"<0.urn:uuid:492264AB42E57108E01176731445508@apache.org>\";"
|
||||
@@ -141,7 +141,7 @@ public abstract class AbstractSoap11MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageMtomWeirdStartInfo() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap11MessageFactoryTest.class.getResourceAsStream("soap11-mtom.bin");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type",
|
||||
"multipart/related;" + "startinfo=\"text/xml\";" + "type=\"application/xop+xml\";"
|
||||
+ "start=\"<0.urn:uuid:492264AB42E57108E01176731445508@apache.org>\";"
|
||||
@@ -179,7 +179,7 @@ public abstract class AbstractSoap11MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageUtf16BigEndianByteOrderMark() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap11MessageFactoryTest.class.getResourceAsStream("soap11-utf16-be-bom.xml");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type", "text/xml; charset=UTF-16");
|
||||
TransportInputStream tis = new MockTransportInputStream(is, headers);
|
||||
|
||||
@@ -192,7 +192,7 @@ public abstract class AbstractSoap11MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageUtf16LittleEndianByteOrderMark() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap11MessageFactoryTest.class.getResourceAsStream("soap11-utf16-le-bom.xml");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type", "text/xml; charset=UTF-16");
|
||||
TransportInputStream tis = new MockTransportInputStream(is, headers);
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public abstract class AbstractSoap12MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageNoAttachment() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap12MessageFactoryTest.class.getResourceAsStream("soap12.xml");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String soapAction = "\"http://springframework.org/spring-ws/Action\"";
|
||||
headers.put(TransportConstants.HEADER_CONTENT_TYPE, "application/soap+xml; action=" + soapAction);
|
||||
TransportInputStream tis = new MockTransportInputStream(is, headers);
|
||||
@@ -69,7 +69,7 @@ public abstract class AbstractSoap12MessageFactoryTest extends AbstractSoapMessa
|
||||
public void doTestCreateSoapMessageIllFormedXml() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap12MessageFactoryTest.class.getResourceAsStream("soap12-ill-formed.xml");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put(TransportConstants.HEADER_CONTENT_TYPE, "application/soap+xml");
|
||||
TransportInputStream tis = new MockTransportInputStream(is, headers);
|
||||
|
||||
@@ -80,7 +80,7 @@ public abstract class AbstractSoap12MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageSwA() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap12MessageFactoryTest.class.getResourceAsStream("soap12-attachment.bin");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type", "multipart/related;" + "type=\"application/soap+xml\";"
|
||||
+ "boundary=\"----=_Part_0_11416420.1149699787554\"");
|
||||
TransportInputStream tis = new MockTransportInputStream(is, headers);
|
||||
@@ -103,7 +103,7 @@ public abstract class AbstractSoap12MessageFactoryTest extends AbstractSoapMessa
|
||||
public void testCreateSoapMessageMtom() throws Exception {
|
||||
|
||||
InputStream is = AbstractSoap12MessageFactoryTest.class.getResourceAsStream("soap12-mtom.bin");
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Content-Type",
|
||||
"multipart/related;" + "start-info=\"application/soap+xml\";" + "type=\"application/xop+xml\";"
|
||||
+ "start=\"<0.urn:uuid:40864869929B855F971176851454456@apache.org>\";"
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MockTransportInputStream extends TransportInputStream {
|
||||
|
||||
Assert.notNull(inputStream, "inputStream must not be null");
|
||||
this.inputStream = inputStream;
|
||||
headers = new HashMap<String, String>();
|
||||
headers = new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
public class MockTransportOutputStream extends TransportOutputStream {
|
||||
|
||||
private Map<String, String> headers = new HashMap<String, String>();
|
||||
private Map<String, String> headers = new HashMap<>();
|
||||
|
||||
private OutputStream outputStream;
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ public abstract class AbstractHttpWebServiceMessageSenderIntegrationTest<T exten
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MyServlet extends HttpServlet {
|
||||
public static class MyServlet extends HttpServlet {
|
||||
|
||||
private int responseStatus = HttpServletResponse.SC_OK;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MessageDispatcherServletTest {
|
||||
private MessageDispatcherServlet servlet;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
config = new MockServletConfig(new MockServletContext(), "spring-ws");
|
||||
servlet = new MessageDispatcherServlet();
|
||||
|
||||
@@ -43,11 +43,16 @@ import static org.easymock.EasyMock.verify;
|
||||
|
||||
public class WebServiceMessageReceiverHandlerAdapterTest {
|
||||
|
||||
private static final String REQUEST = " <SOAP-ENV:Envelope\n"
|
||||
+ " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n"
|
||||
+ " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n" + " <SOAP-ENV:Body>\n"
|
||||
+ " <m:GetLastTradePrice xmlns:m=\"Some-URI\">\n" + " <symbol>DIS</symbol>\n"
|
||||
+ " </m:GetLastTradePrice>\n" + " </SOAP-ENV:Body>\n" + "</SOAP-ENV:Envelope>";
|
||||
private static final String REQUEST = """
|
||||
<SOAP-ENV:Envelope
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
||||
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||
<SOAP-ENV:Body>
|
||||
<m:GetLastTradePrice xmlns:m="Some-URI">
|
||||
<symbol>DIS</symbol>
|
||||
</m:GetLastTradePrice>
|
||||
</SOAP-ENV:Body>
|
||||
</SOAP-ENV:Envelope>""";
|
||||
|
||||
private WebServiceMessageReceiverHandlerAdapter adapter;
|
||||
|
||||
@@ -62,7 +67,7 @@ public class WebServiceMessageReceiverHandlerAdapterTest {
|
||||
private FaultAwareWebServiceMessage requestMock;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
adapter = new WebServiceMessageReceiverHandlerAdapter();
|
||||
httpRequest = new MockHttpServletRequest();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WebServiceMessageReceiverObjectSupportTest {
|
||||
private MockWebServiceMessage request;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
|
||||
receiverSupport = new MyReceiverSupport();
|
||||
messageFactory = new MockWebServiceMessageFactory();
|
||||
@@ -67,7 +67,7 @@ public class WebServiceMessageReceiverObjectSupportTest {
|
||||
WebServiceMessageReceiver receiver = new WebServiceMessageReceiver() {
|
||||
|
||||
@Override
|
||||
public void receive(MessageContext messageContext) throws Exception {
|
||||
public void receive(MessageContext messageContext) {
|
||||
assertThat(messageContext).isNotNull();
|
||||
messageContext.getResponse();
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class WebServiceMessageReceiverObjectSupportTest {
|
||||
WebServiceMessageReceiver receiver = new WebServiceMessageReceiver() {
|
||||
|
||||
@Override
|
||||
public void receive(MessageContext messageContext) throws Exception {
|
||||
public void receive(MessageContext messageContext) {
|
||||
|
||||
assertThat(messageContext).isNotNull();
|
||||
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
|
||||
@@ -112,7 +112,7 @@ public class WebServiceMessageReceiverObjectSupportTest {
|
||||
|
||||
WebServiceMessageReceiver receiver = new WebServiceMessageReceiver() {
|
||||
|
||||
public void receive(MessageContext messageContext) throws Exception {
|
||||
public void receive(MessageContext messageContext) {
|
||||
assertThat(messageContext).isNotNull();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -57,6 +57,7 @@ public class DefaultMessagesProviderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testAddMessages() throws Exception {
|
||||
|
||||
String definitionNamespace = "http://springframework.org/spring-ws";
|
||||
|
||||
@@ -60,6 +60,7 @@ public class Soap11ProviderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testPopulateBinding() throws Exception {
|
||||
|
||||
String namespace = "http://springframework.org/spring-ws";
|
||||
|
||||
@@ -60,6 +60,7 @@ public class Soap12ProviderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testPopulateBinding() throws Exception {
|
||||
String namespace = "http://springframework.org/spring-ws";
|
||||
definition.addNamespace("tns", namespace);
|
||||
|
||||
@@ -51,6 +51,7 @@ public class SoapProviderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testPopulateBinding() throws Exception {
|
||||
|
||||
String namespace = "http://springframework.org/spring-ws";
|
||||
|
||||
@@ -58,6 +58,7 @@ public class SuffixBasedMessagesProviderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testAddMessages() throws Exception {
|
||||
|
||||
String definitionNamespace = "http://springframework.org/spring-ws";
|
||||
|
||||
@@ -43,6 +43,7 @@ public class SuffixBasedPortTypesProviderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testAddPortTypes() throws Exception {
|
||||
|
||||
String namespace = "http://springframework.org/spring-ws";
|
||||
|
||||
Reference in New Issue
Block a user