1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.test.server;
18
19 import org.springframework.context.support.StaticApplicationContext;
20 import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
21 import org.springframework.ws.soap.server.SoapMessageDispatcher;
22
23 import org.junit.Test;
24
25 import static org.junit.Assert.assertNotNull;
26
27 public class MockWebServiceClientTest {
28
29 @Test
30 public void createServerApplicationContext() throws Exception {
31 StaticApplicationContext applicationContext = new StaticApplicationContext();
32 applicationContext.registerSingleton("messageDispatcher", SoapMessageDispatcher.class);
33 applicationContext.registerSingleton("messageFactory", SaajSoapMessageFactory.class);
34 applicationContext.refresh();
35
36 MockWebServiceClient client = MockWebServiceClient.createClient(applicationContext);
37 assertNotNull(client);
38 }
39
40 @Test
41 public void createServerApplicationContextDefaults() throws Exception {
42 StaticApplicationContext applicationContext = new StaticApplicationContext();
43 applicationContext.refresh();
44
45 MockWebServiceClient client = MockWebServiceClient.createClient(applicationContext);
46 assertNotNull(client);
47 }
48 }