Example usage for org.springframework.integration.gateway TestService oneWay

List of usage examples for org.springframework.integration.gateway TestService oneWay

Introduction

In this page you can find the example usage for org.springframework.integration.gateway TestService oneWay.

Prototype

void oneWay(String input);

Source Link

Usage

From source file:org.springframework.integration.config.xml.GatewayParserTests.java

@Test
public void testOneWay() {
    TestService service = (TestService) context.getBean("oneWay");
    service.oneWay("foo");
    PollableChannel channel = (PollableChannel) context.getBean("requestChannel");
    Message<?> result = channel.receive(1000);
    assertEquals("foo", result.getPayload());
}

From source file:org.springframework.integration.config.xml.GatewayParserTests.java

@Test
public void testOneWayOverride() {
    TestService service = (TestService) context.getBean("methodOverride");
    service.oneWay("foo");
    PollableChannel channel = (PollableChannel) context.getBean("otherRequestChannel");
    Message<?> result = channel.receive(1000);
    assertEquals("fiz", result.getPayload());
    assertEquals("bar", result.getHeaders().get("foo"));
    assertEquals("qux", result.getHeaders().get("baz"));
    GatewayProxyFactoryBean fb = context.getBean("&methodOverride", GatewayProxyFactoryBean.class);
    Map<?, ?> methods = TestUtils.getPropertyValue(fb, "methodMetadataMap", Map.class);
    GatewayMethodMetadata meta = (GatewayMethodMetadata) methods.get("oneWay");
    assertNotNull(meta);/*from ww w  . ja  va  2s  .c o  m*/
    assertEquals("456", meta.getRequestTimeout());
    assertEquals("123", meta.getReplyTimeout());
    assertEquals("foo", meta.getReplyChannelName());
}