1 package de.spring.webservices.endpoints;
3 import static org.mockito.Mockito.mock;
4 import static org.mockito.Mockito.verify;
6 import org.junit.Before;
9 import de.spring.webservices.operations.Operations;
10 import de.spring.webservices.server.auto.CustomBindingExampleRequest;
11 import de.spring.webservices.server.auto.CustomBindingExampleResponse;
12 import de.spring.webservices.server.auto.ExampleRequest;
13 import de.spring.webservices.services.ExampleService;
16 public class ExampleEndPointTest {
18 private ExampleService exampleService;
20 private Operations.RequestResponse
21 <CustomBindingExampleResponse, CustomBindingExampleRequest> customBindingExampleService;
23 private ExampleEndPoint exampleEndPoint;
27 exampleService = mock(ExampleService.class);
28 customBindingExampleService = mock(Operations.RequestResponse.class);
29 exampleEndPoint = new ExampleEndPoint(customBindingExampleService, exampleService);
33 public void givenExampleRequestThenInvokeExampleService() {
34 ExampleRequest request = new ExampleRequest();
35 request.setData("SCARLETT");
37 exampleEndPoint.exampleResponse(request, null, null);
39 verify(exampleService).doResponse(request);
43 public void givenCustomBindingExampleRequestThenInvokeCustomBindingExampleService() {
44 CustomBindingExampleRequest request = new CustomBindingExampleRequest();
45 request.setData("SCARLETT");
47 exampleEndPoint.cuntomBindingExampleResponse(request, null, null);
49 verify(customBindingExampleService).requestResponse(request);