use of org.springframework.integration.endpoint.AbstractEndpoint 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"));
}
use of org.springframework.integration.endpoint.AbstractEndpoint in project spring-integration by spring-projects.
the class WebServiceOutboundGatewayParserTests method marshallingGatewayWithSeparateMarshallerAndUnmarshallerAndMessageFactory.
@Test
public void marshallingGatewayWithSeparateMarshallerAndUnmarshallerAndMessageFactory() {
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("marshallingWebServiceOutboundGatewayParserTests.xml", this.getClass());
AbstractEndpoint endpoint = (AbstractEndpoint) context.getBean("gatewayWithSeparateMarshallerAndUnmarshallerAndMessageFactory");
assertEquals(EventDrivenConsumer.class, endpoint.getClass());
Object gateway = TestUtils.getPropertyValue(endpoint, "handler");
Marshaller marshaller = context.getBean("marshaller", Marshaller.class);
Unmarshaller unmarshaller = context.getBean("unmarshaller", Unmarshaller.class);
assertSame(marshaller, TestUtils.getPropertyValue(gateway, "webServiceTemplate.marshaller", Marshaller.class));
assertSame(unmarshaller, TestUtils.getPropertyValue(gateway, "webServiceTemplate.unmarshaller", Unmarshaller.class));
WebServiceMessageFactory messageFactory = context.getBean("messageFactory", WebServiceMessageFactory.class);
assertEquals(messageFactory, TestUtils.getPropertyValue(gateway, "webServiceTemplate.messageFactory"));
context.close();
}
use of org.springframework.integration.endpoint.AbstractEndpoint in project spring-integration by spring-projects.
the class WebServiceOutboundGatewayParserTests method simpleGatewayWithCustomInterceptorList.
@Test
public void simpleGatewayWithCustomInterceptorList() {
AbstractEndpoint endpoint = this.context.getBean("gatewayWithCustomInterceptorList", AbstractEndpoint.class);
assertEquals(EventDrivenConsumer.class, endpoint.getClass());
Object gateway = new DirectFieldAccessor(endpoint).getPropertyValue("handler");
assertEquals(SimpleWebServiceOutboundGateway.class, gateway.getClass());
DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
accessor = new DirectFieldAccessor(accessor.getPropertyValue("webServiceTemplate"));
ClientInterceptor interceptor = context.getBean("interceptor", ClientInterceptor.class);
assertEquals(interceptor, ((ClientInterceptor[]) accessor.getPropertyValue("interceptors"))[0]);
assertEquals("Wrong number of interceptors ", 2, ((ClientInterceptor[]) accessor.getPropertyValue("interceptors")).length);
}
use of org.springframework.integration.endpoint.AbstractEndpoint in project spring-integration by spring-projects.
the class WebServiceOutboundGatewayParserTests method simpleGatewayWithIgnoreEmptyResponseTrueByDefault.
@Test
public void simpleGatewayWithIgnoreEmptyResponseTrueByDefault() {
AbstractEndpoint endpoint = this.context.getBean("gatewayWithReplyChannel", AbstractEndpoint.class);
assertEquals(EventDrivenConsumer.class, endpoint.getClass());
Object gateway = new DirectFieldAccessor(endpoint).getPropertyValue("handler");
assertEquals(SimpleWebServiceOutboundGateway.class, gateway.getClass());
DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
assertEquals(Boolean.TRUE, accessor.getPropertyValue("ignoreEmptyResponses"));
Assert.assertEquals(Boolean.FALSE, accessor.getPropertyValue("requiresReply"));
}
use of org.springframework.integration.endpoint.AbstractEndpoint in project spring-integration by spring-projects.
the class WebServiceOutboundGatewayParserTests method marshallingGatewayWithAllInOneMarshaller.
@Test
public void marshallingGatewayWithAllInOneMarshaller() {
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("marshallingWebServiceOutboundGatewayParserTests.xml", this.getClass());
AbstractEndpoint endpoint = (AbstractEndpoint) context.getBean("gatewayWithAllInOneMarshaller");
assertEquals(EventDrivenConsumer.class, endpoint.getClass());
Object gateway = TestUtils.getPropertyValue(endpoint, "handler");
Marshaller marshaller = context.getBean("marshallerAndUnmarshaller", Marshaller.class);
assertSame(marshaller, TestUtils.getPropertyValue(gateway, "webServiceTemplate.marshaller", Marshaller.class));
assertSame(marshaller, TestUtils.getPropertyValue(gateway, "webServiceTemplate.unmarshaller", Unmarshaller.class));
context.close();
}
Aggregations