1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.server.endpoint;
18
19 import org.jdom2.Element;
20 import org.jdom2.Namespace;
21
22 import static org.junit.Assert.*;
23
24 public class JDomPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
25
26 @Override
27 protected PayloadEndpoint createNoResponseEndpoint() throws Exception {
28 return new AbstractJDomPayloadEndpoint() {
29
30 @Override
31 protected Element invokeInternal(Element requestElement) throws Exception {
32 return null;
33 }
34 };
35 }
36
37 @Override
38 protected PayloadEndpoint createResponseEndpoint() throws Exception {
39 return new AbstractJDomPayloadEndpoint() {
40
41 @Override
42 protected Element invokeInternal(Element requestElement) throws Exception {
43 assertNotNull("No requestElement passed", requestElement);
44 assertEquals("Invalid request element", REQUEST_ELEMENT, requestElement.getName());
45 assertEquals("Invalid request element", NAMESPACE_URI, requestElement.getNamespaceURI());
46 return new Element(RESPONSE_ELEMENT, Namespace.getNamespace("tns", NAMESPACE_URI));
47 }
48 };
49 }
50
51 @Override
52 protected PayloadEndpoint createNoRequestEndpoint() throws Exception {
53 return new AbstractJDomPayloadEndpoint() {
54
55 @Override
56 protected Element invokeInternal(Element requestElement) throws Exception {
57 assertNull("RequestElement passed", requestElement);
58 return null;
59 }
60 };
61 }
62 }