Search in sources :

Example 1 with SourceExtractor

use of org.springframework.ws.client.core.SourceExtractor in project spring-integration by spring-projects.

the class WebServiceOutboundGatewayParserTests method simpleGatewayWithCustomSourceExtractor.

@Test
public void simpleGatewayWithCustomSourceExtractor() {
    AbstractEndpoint endpoint = this.context.getBean("gatewayWithCustomSourceExtractor", AbstractEndpoint.class);
    assertEquals(EventDrivenConsumer.class, endpoint.getClass());
    Object gateway = new DirectFieldAccessor(endpoint).getPropertyValue("handler");
    assertEquals(SimpleWebServiceOutboundGateway.class, gateway.getClass());
    DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
    SourceExtractor<?> sourceExtractor = (SourceExtractor<?>) context.getBean("sourceExtractor");
    assertEquals(sourceExtractor, accessor.getPropertyValue("sourceExtractor"));
}
Also used : AbstractEndpoint(org.springframework.integration.endpoint.AbstractEndpoint) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) SourceExtractor(org.springframework.ws.client.core.SourceExtractor) Test(org.junit.Test)

Example 2 with SourceExtractor

use of org.springframework.ws.client.core.SourceExtractor in project spring-integration by spring-projects.

the class WebServiceOutboundGatewayParserTests method simpleGatewayWithCustomSourceExtractorAndMessageFactory.

@Test
public void simpleGatewayWithCustomSourceExtractorAndMessageFactory() {
    AbstractEndpoint endpoint = context.getBean("gatewayWithCustomSourceExtractorAndMessageFactory", AbstractEndpoint.class);
    SourceExtractor<?> sourceExtractor = (SourceExtractor<?>) context.getBean("sourceExtractor");
    assertEquals(EventDrivenConsumer.class, endpoint.getClass());
    Object gateway = new DirectFieldAccessor(endpoint).getPropertyValue("handler");
    assertEquals(SimpleWebServiceOutboundGateway.class, gateway.getClass());
    DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
    assertEquals(sourceExtractor, accessor.getPropertyValue("sourceExtractor"));
    accessor = new DirectFieldAccessor(accessor.getPropertyValue("webServiceTemplate"));
    WebServiceMessageFactory factory = (WebServiceMessageFactory) context.getBean("messageFactory");
    assertEquals(factory, accessor.getPropertyValue("messageFactory"));
}
Also used : AbstractEndpoint(org.springframework.integration.endpoint.AbstractEndpoint) WebServiceMessageFactory(org.springframework.ws.WebServiceMessageFactory) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) SourceExtractor(org.springframework.ws.client.core.SourceExtractor) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)2 AbstractEndpoint (org.springframework.integration.endpoint.AbstractEndpoint)2 SourceExtractor (org.springframework.ws.client.core.SourceExtractor)2 WebServiceMessageFactory (org.springframework.ws.WebServiceMessageFactory)1