Package org.springframework.ws

Examples of org.springframework.ws.MockWebServiceMessage


        WebServiceMessageReceiver receiver = new WebServiceMessageReceiver() {

            @Override
            public void receive(MessageContext messageContext) throws Exception {
                Assert.assertNotNull("No message context", messageContext);
                MockWebServiceMessage response =
                    (MockWebServiceMessage) messageContext.getResponse();
              response.setFaultCode(faultCode);
            }
        };

        receiverSupport.handleConnection(connectionMock, receiver);
View Full Code Here


    @Before
    public void setUp() throws Exception {
        dispatcher = new MessageDispatcher();
        factoryMock = createMock(WebServiceMessageFactory.class);
        messageContext = new DefaultMessageContext(new MockWebServiceMessage(), factoryMock);
    }
View Full Code Here

                return true;
            }

        };
        dispatcher.setEndpointExceptionResolvers(Collections.singletonList(resolver));
        expect(factoryMock.createWebServiceMessage()).andReturn(new MockWebServiceMessage());

        replay(factoryMock);

        dispatcher.dispatch(messageContext);
        Assert.assertNotNull("processEndpointException sets no response", messageContext.getResponse());
View Full Code Here

        EndpointInvocationChain chain =
                new EndpointInvocationChain(endpoint, new EndpointInterceptor[]{interceptorMock1, interceptorMock2});

        expect(mappingMock.getEndpoint(messageContext)).andReturn(chain);
        expect(factoryMock.createWebServiceMessage()).andReturn(new MockWebServiceMessage());

        replay(mappingMock, interceptorMock1, interceptorMock2, adapterMock, factoryMock);

        //  response required for interceptor invocation
        messageContext.getResponse();
View Full Code Here

        EndpointInvocationChain chain =
                new EndpointInvocationChain(endpoint, new EndpointInterceptor[]{interceptorMock1, interceptorMock2});

        expect(mappingMock.getEndpoint(messageContext)).andReturn(chain);
        expect(factoryMock.createWebServiceMessage()).andReturn(new MockWebServiceMessage());

        replay(mappingMock, interceptorMock1, interceptorMock2, adapterMock, factoryMock);

        //  response required for interceptor invocation
        messageContext.getResponse();
View Full Code Here

        EndpointInvocationChain chain =
                new EndpointInvocationChain(endpoint, new EndpointInterceptor[]{interceptorMock1, interceptorMock2});

        expect(mappingMock.getEndpoint(messageContext)).andReturn(chain);
        expect(factoryMock.createWebServiceMessage()).andReturn(new MockWebServiceMessage());

        replay(mappingMock, interceptorMock1, interceptorMock2, adapterMock, factoryMock);

        //  response required for interceptor invocation
        messageContext.getResponse();
View Full Code Here

        EndpointInvocationChain chain =
                new EndpointInvocationChain(endpoint, new EndpointInterceptor[]{interceptorMock});

        expect(mappingMock.getEndpoint(messageContext)).andReturn(chain);
        expect(factoryMock.createWebServiceMessage()).andReturn(new MockWebServiceMessage());

        replay(mappingMock, interceptorMock, adapterMock, factoryMock, resolverMock);

        //  response required for interceptor invocation
        messageContext.getResponse();
View Full Code Here

        EndpointInvocationChain chain =
                new EndpointInvocationChain(endpoint, new EndpointInterceptor[]{interceptorMock});

        expect(mappingMock.getEndpoint(messageContext)).andReturn(chain);
        MockWebServiceMessage response = new MockWebServiceMessage();
        response.setFault(true);
        expect(factoryMock.createWebServiceMessage()).andReturn(response);

        replay(mappingMock, interceptorMock, adapterMock, factoryMock);

        //  response required for interceptor invocation
View Full Code Here

    private WebServiceMessage request;

    @Before
    public void setUp() throws Exception {
        factoryMock = createMock(WebServiceMessageFactory.class);
        request = new MockWebServiceMessage();
        context = new DefaultMessageContext(request, factoryMock);
    }
View Full Code Here

        Assert.assertEquals("Invalid request returned", request, context.getRequest());
    }

    @Test
    public void testResponse() throws Exception {
        WebServiceMessage response = new MockWebServiceMessage();
        expect(factoryMock.createWebServiceMessage()).andReturn(response);
        replay(factoryMock);

        WebServiceMessage result = context.getResponse();
        Assert.assertEquals("Invalid response returned", response, result);
View Full Code Here

TOP

Related Classes of org.springframework.ws.MockWebServiceMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.