Package com.consol.citrus.ws.client

Examples of com.consol.citrus.ws.client.WebServiceClient$InternalFaultMessageResolver


        Map<String, WebServiceClient> messageSenders = beanDefinitionContext.getBeansOfType(WebServiceClient.class);

        Assert.assertEquals(messageSenders.size(), 6);

        // 1st message sender
        WebServiceClient client = messageSenders.get("soapClient1");
        Assert.assertEquals(client.getEndpointConfiguration().getDefaultUri(), "http://localhost:8080/test");
        Assert.assertTrue(client.getEndpointConfiguration().getMessageFactory() instanceof SoapMessageFactory);
        Assert.assertEquals(client.getEndpointConfiguration().getCorrelator().getClass(), DefaultMessageCorrelator.class);
        Assert.assertNotNull(client.getEndpointConfiguration().getInterceptor());
        Assert.assertEquals(client.getEndpointConfiguration().getInterceptor().getClass(), LoggingClientInterceptor.class);
        Assert.assertTrue(client.getEndpointConfiguration().getMessageConverter() instanceof SoapMessageConverter);
        Assert.assertEquals(client.getEndpointConfiguration().getErrorHandlingStrategy(), ErrorHandlingStrategy.THROWS_EXCEPTION);
        Assert.assertEquals(client.getEndpointConfiguration().getTimeout(), 5000L);
        Assert.assertNotNull(client.getEndpointConfiguration().getWebServiceTemplate());

        // 2nd message sender
        client = messageSenders.get("soapClient2");
        Assert.assertEquals(client.getEndpointConfiguration().getDefaultUri(), "http://localhost:8080/test");
        Assert.assertEquals(client.getEndpointConfiguration().getMessageFactory(), beanDefinitionContext.getBean("soapMessageFactory"));
        Assert.assertEquals(client.getEndpointConfiguration().getCorrelator().getClass(), DefaultMessageCorrelator.class);
        Assert.assertEquals(client.getEndpointConfiguration().getEndpointResolver(), beanDefinitionContext.getBean("endpointResolver"));
        Assert.assertEquals(client.getEndpointConfiguration().getErrorHandlingStrategy(), ErrorHandlingStrategy.THROWS_EXCEPTION);
        Assert.assertEquals(client.getEndpointConfiguration().getTimeout(), 10000L);
        Assert.assertNotNull(client.getEndpointConfiguration().getWebServiceTemplate());
        Assert.assertEquals(client.getEndpointConfiguration().getWebServiceTemplate().getMessageFactory(), beanDefinitionContext.getBean("soapMessageFactory"));

        // 3rd message sender
        client = messageSenders.get("soapClient3");
        Assert.assertEquals(client.getEndpointConfiguration().getDefaultUri(), "http://localhost:8080/test");
        Assert.assertNotNull(client.getEndpointConfiguration().getCorrelator());
        Assert.assertEquals(client.getEndpointConfiguration().getCorrelator(), beanDefinitionContext.getBean("replyMessageCorrelator"));
        Assert.assertEquals(client.getEndpointConfiguration().getErrorHandlingStrategy(), ErrorHandlingStrategy.THROWS_EXCEPTION);
        Assert.assertNotNull(client.getEndpointConfiguration().getWebServiceTemplate());
        Assert.assertEquals(client.getEndpointConfiguration().getWebServiceTemplate(), beanDefinitionContext.getBean("wsTemplate"));

        // 4th message sender
        client = messageSenders.get("soapClient4");
        Assert.assertEquals(client.getEndpointConfiguration().getDefaultUri(), "http://localhost:8080/test");
        Assert.assertTrue(client.getEndpointConfiguration().getMessageFactory() instanceof SoapMessageFactory);
        Assert.assertEquals(client.getEndpointConfiguration().getErrorHandlingStrategy(), ErrorHandlingStrategy.THROWS_EXCEPTION);
        Assert.assertNotNull(client.getEndpointConfiguration().getMessageSender());
        Assert.assertEquals(client.getEndpointConfiguration().getMessageSender(), beanDefinitionContext.getBean("wsMessageSender"));
        Assert.assertNotNull(client.getEndpointConfiguration().getInterceptor());
        Assert.assertEquals(client.getEndpointConfiguration().getInterceptor(), beanDefinitionContext.getBean("singleInterceptor"));
        Assert.assertNotNull(client.getEndpointConfiguration().getWebServiceTemplate());
        Assert.assertEquals(client.getEndpointConfiguration().getWebServiceTemplate().getInterceptors().length, 1L);
        Assert.assertTrue(client.getEndpointConfiguration().getMessageConverter() instanceof WsAddressingMessageConverter);

        // 5th message sender
        client = messageSenders.get("soapClient5");
        Assert.assertEquals(client.getEndpointConfiguration().getDefaultUri(), "http://localhost:8080/test");
        Assert.assertEquals(client.getEndpointConfiguration().getErrorHandlingStrategy(), ErrorHandlingStrategy.PROPAGATE);
        Assert.assertNotNull(client.getEndpointConfiguration().getInterceptors());
        Assert.assertEquals(client.getEndpointConfiguration().getInterceptors().size(), 2L);
        Assert.assertEquals(client.getEndpointConfiguration().getInterceptors().get(0), beanDefinitionContext.getBean("interceptor1"));
        Assert.assertEquals(client.getEndpointConfiguration().getInterceptors().get(1), beanDefinitionContext.getBean("interceptor2"));
        Assert.assertEquals(client.getEndpointConfiguration().getPollingInterval(), 250L);
        Assert.assertNotNull(client.getEndpointConfiguration().getWebServiceTemplate());
        Assert.assertEquals(client.getEndpointConfiguration().getWebServiceTemplate().getInterceptors().length, 2L);

        // 5th message sender
        client = messageSenders.get("soapClient6");
        Assert.assertNotNull(client.getActor());
        Assert.assertEquals(client.getActor(), beanDefinitionContext.getBean("testActor", TestActor.class));
    }
View Full Code Here

TOP

Related Classes of com.consol.citrus.ws.client.WebServiceClient$InternalFaultMessageResolver

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.