Examples of MockWebServiceMessage


Examples of org.springframework.ws.MockWebServiceMessage

        Assert.assertFalse("Response set", context.hasResponse());
    }

    @Test
    public void testHandleInvalidResponse() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        MockWebServiceMessage response = (MockWebServiceMessage) context.getResponse();
        response.setPayload(new ClassPathResource(INVALID_MESSAGE, getClass()));
        boolean result = interceptor.handleResponse(context, null);
        Assert.assertFalse("Invalid response from interceptor", result);
    }
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

        Assert.assertFalse("Invalid response from interceptor", result);
    }

    @Test
    public void testHandleValidResponse() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        MockWebServiceMessage response = (MockWebServiceMessage) context.getResponse();
        response.setPayload(new ClassPathResource(VALID_MESSAGE, getClass()));
        boolean result = interceptor.handleResponse(context, null);
        Assert.assertTrue("Invalid response from interceptor", result);
    }
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

    @Test
    public void testHandlerInvalidRequestMultipleSchemas() throws Exception {
        interceptor.setSchemas(new Resource[]{new ClassPathResource(PRODUCT_SCHEMA, getClass()),
                new ClassPathResource(SIZE_SCHEMA, getClass())});
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage(new ClassPathResource(INVALID_MESSAGE, getClass()));
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        boolean result = interceptor.handleRequest(context, null);
        Assert.assertFalse("Invalid response from interceptor", result);
    }
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

    @Test
    public void testHandleValidRequestMultipleSchemas() throws Exception {
        interceptor.setSchemas(new Resource[]{new ClassPathResource(PRODUCT_SCHEMA, getClass()),
                new ClassPathResource(SIZE_SCHEMA, getClass())});
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage(new ClassPathResource(VALID_MESSAGE, getClass()));
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());

        boolean result = interceptor.handleRequest(context, null);
        Assert.assertTrue("Invalid response from interceptor", result);
        Assert.assertFalse("Response set", context.hasResponse());
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

    @Test
    public void testHandleInvalidResponseMultipleSchemas() throws Exception {
        interceptor.setSchemas(new Resource[]{new ClassPathResource(PRODUCT_SCHEMA, getClass()),
                new ClassPathResource(SIZE_SCHEMA, getClass())});
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage();
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        MockWebServiceMessage response = (MockWebServiceMessage) context.getResponse();
        response.setPayload(new ClassPathResource(INVALID_MESSAGE, getClass()));
        boolean result = interceptor.handleResponse(context, null);
        Assert.assertFalse("Invalid response from interceptor", result);
    }
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

    @Test
    public void testHandleValidResponseMultipleSchemas() throws Exception {
        interceptor.setSchemas(new Resource[]{new ClassPathResource(PRODUCT_SCHEMA, getClass()),
                new ClassPathResource(SIZE_SCHEMA, getClass())});
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage();
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        MockWebServiceMessage response = (MockWebServiceMessage) context.getResponse();
        response.setPayload(new ClassPathResource(VALID_MESSAGE, getClass()));
        boolean result = interceptor.handleResponse(context, null);
        Assert.assertTrue("Invalid response from interceptor", result);
    }
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

        schema.afterPropertiesSet();
        interceptor.setXsdSchema(schema);
        interceptor.setValidateRequest(true);
        interceptor.setValidateResponse(true);
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage();
        request.setPayload(new ClassPathResource(VALID_MESSAGE, getClass()));
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        boolean result = interceptor.handleRequest(context, null);
        Assert.assertTrue("Invalid response from interceptor", result);
        Assert.assertFalse("Response set", context.hasResponse());
    }
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

        Assert.assertFalse("Invalid response from interceptor", validated);
    }

    @Test
    public void testHandlerInvalidRequest() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        request.setPayload(new ClassPathResource(INVALID_MESSAGE, getClass()));
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());

        boolean validated;
        try {
            validated = interceptor.handleRequest(context);
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

        Assert.assertFalse("Invalid response from interceptor", validated);
    }

    @Test
    public void testHandleValidRequest() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        request.setPayload(new ClassPathResource(VALID_MESSAGE, getClass()));
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        boolean result = interceptor.handleRequest(context);
        Assert.assertTrue("Invalid response from interceptor", result);
        Assert.assertFalse("Response set", context.hasResponse());
    }
View Full Code Here

Examples of org.springframework.ws.MockWebServiceMessage

        Assert.assertFalse("Response set", context.hasResponse());
    }

    @Test
    public void testHandleInvalidResponse() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        MockWebServiceMessage response = (MockWebServiceMessage) context.getResponse();
        response.setPayload(new ClassPathResource(INVALID_MESSAGE, getClass()));

        boolean result = interceptor.handleResponse(context);
        Assert.assertFalse("Invalid response from interceptor", result);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.