Search in sources :

Example 1 with MethodInvocation

use of org.apache.camel.component.bean.MethodInvocation in project camel by apache.

the class BeanInfoTest method testFindsSingleMethodMatchingBody.

public void testFindsSingleMethodMatchingBody() throws Throwable {
    MethodInvocation invocation = info.createInvocation(bean, exchange);
    assertNotNull("Should have found a method invocation!", invocation);
    AtomicBoolean sync = new AtomicBoolean(true);
    invocation.proceed(new AsyncCallback() {

        public void done(boolean doneSync) {
        // nnop
        }
    });
    assertEquals(true, sync.get());
    assertEquals("Hello James!", exchange.getIn().getBody());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AsyncCallback(org.apache.camel.AsyncCallback) MethodInvocation(org.apache.camel.component.bean.MethodInvocation)

Aggregations

AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 AsyncCallback (org.apache.camel.AsyncCallback)1 MethodInvocation (org.apache.camel.component.bean.MethodInvocation)1