CitrusMessageDispatcherServlet extends MessageDispatcherServlet { protected void configureMessageEndpoint(ApplicationContext context) { if (context.containsBean(MESSAGE_ENDPOINT_BEAN_NAME)) { WebServiceEndpoint messageEndpoint = context.getBean(MESSAGE_ENDPOINT_BEAN_NAME, WebServiceEndpoint.class); EndpointAdapter endpointAdapter = webServiceServer.getEndpointAdapter(); if (endpointAdapter != null) { messageEndpoint.setEndpointAdapter(endpointAdapter); } WebServiceEndpointConfiguration endpointConfiguration = new WebServiceEndpointConfiguration(); endpointConfiguration.setHandleMimeHeaders(webServiceServer.isHandleMimeHeaders()); endpointConfiguration.setHandleAttributeHeaders(webServiceServer.isHandleAttributeHeaders()); endpointConfiguration.setKeepSoapEnvelope(webServiceServer.isKeepSoapEnvelope()); endpointConfiguration.setMessageConverter(webServiceServer.getMessageConverter()); messageEndpoint.setEndpointConfiguration(endpointConfiguration); if (StringUtils.hasText(webServiceServer.getSoapHeaderNamespace())) { messageEndpoint.setDefaultNamespaceUri(webServiceServer.getSoapHeaderNamespace()); } if (StringUtils.hasText(webServiceServer.getSoapHeaderPrefix())) { messageEndpoint.setDefaultPrefix(webServiceServer.getSoapHeaderPrefix()); } } } CitrusMessageDispatcherServlet(WebServiceServer webServiceServer);   }
@Test public void testConfigureMessageEndpoint() throws Exception { reset(webServiceServer); when(webServiceServer.getInterceptors()).thenReturn(null); when(webServiceServer.getEndpointAdapter()).thenReturn(new TimeoutProducingEndpointAdapter()); when(webServiceServer.getMessageConverter()).thenReturn(new WsAddressingMessageConverter(new WsAddressingHeaders())); when(webServiceServer.isHandleMimeHeaders()).thenReturn(true); when(webServiceServer.isHandleAttributeHeaders()).thenReturn(true); when(webServiceServer.isKeepSoapEnvelope()).thenReturn(true); when(webServiceServer.getSoapHeaderNamespace()).thenReturn("http: when(webServiceServer.getSoapHeaderPrefix()).thenReturn("CITRUS"); servlet.initStrategies(applicationContext); Assert.assertEquals(endpointInterceptor.getInterceptors().size(), 0L); Assert.assertEquals(webServiceEndpoint.getEndpointAdapter().getClass(), TimeoutProducingEndpointAdapter.class); Assert.assertEquals(webServiceEndpoint.getEndpointConfiguration().getMessageConverter().getClass(), WsAddressingMessageConverter.class); Assert.assertTrue(webServiceEndpoint.getEndpointConfiguration().isHandleMimeHeaders()); Assert.assertTrue(webServiceEndpoint.getEndpointConfiguration().isHandleAttributeHeaders()); Assert.assertTrue(webServiceEndpoint.getEndpointConfiguration().isKeepSoapEnvelope()); Assert.assertEquals(webServiceEndpoint.getDefaultNamespaceUri(), "http: Assert.assertEquals(webServiceEndpoint.getDefaultPrefix(), "CITRUS"); }