Example usage for org.springframework.messaging MessagingException getClass

List of usage examples for org.springframework.messaging MessagingException getClass

Introduction

In this page you can find the example usage for org.springframework.messaging MessagingException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.springframework.integration.handler.AsyncHandlerTests.java

@Test
public void testGatewayWithException() throws Exception {
    this.whichTest = 0;
    GatewayProxyFactoryBean gpfb = new GatewayProxyFactoryBean(Foo.class);
    gpfb.setBeanFactory(mock(BeanFactory.class));
    DirectChannel input = new DirectChannel();
    gpfb.setDefaultRequestChannel(input);
    gpfb.setDefaultReplyTimeout(10000L);
    gpfb.afterPropertiesSet();/* www  . j a v  a  2 s .  co  m*/
    Foo foo = (Foo) gpfb.getObject();
    this.handler.setOutputChannel(null);
    EventDrivenConsumer consumer = new EventDrivenConsumer(input, this.handler);
    consumer.afterPropertiesSet();
    consumer.start();
    this.latch.countDown();
    try {
        foo.exchange("foo");
    } catch (MessagingException e) {
        assertThat(e.getClass().getSimpleName(), equalTo("RuntimeException"));
        assertThat(e.getMessage(), equalTo("foo"));
    }
}