1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.soap.addressing.server;
18
19 import java.net.URI;
20
21 import org.springframework.ws.context.DefaultMessageContext;
22 import org.springframework.ws.context.MessageContext;
23 import org.springframework.ws.soap.SoapMessage;
24 import org.springframework.ws.soap.addressing.version.Addressing10;
25 import org.springframework.ws.soap.addressing.version.AddressingVersion;
26 import org.springframework.ws.soap.saaj.SaajSoapMessage;
27 import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
28
29 public class AddressingInterceptor10Test extends AbstractAddressingInterceptorTestCase {
30
31 protected AddressingVersion getVersion() {
32 return new Addressing10();
33 }
34
35 protected String getTestPath() {
36 return "10";
37 }
38
39 public void testNoTo() throws Exception {
40 SaajSoapMessage valid = loadSaajMessage(getTestPath() + "/request-no-to.xml");
41 MessageContext context = new DefaultMessageContext(valid, new SaajSoapMessageFactory(messageFactory));
42 URI messageId = new URI("uid:1234");
43 strategyControl.expectAndReturn(strategyMock.newMessageId((SoapMessage) context.getResponse()), messageId);
44 strategyControl.replay();
45 boolean result = interceptor.handleResponse(context, null);
46 assertTrue("Request with no To not handled", result);
47 assertTrue("Message Context has no response", context.hasResponse());
48 SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-anonymous.xml");
49 assertXMLEqual("Invalid response for message with invalid MAP", expectedResponse,
50 (SaajSoapMessage) context.getResponse());
51 strategyControl.verify();
52 }
53
54 }