Search in sources :

Example 1 with DummyBean

use of org.apache.camel.spring.example.DummyBean in project camel by apache.

the class EndpointReferenceTest method testEndpointConfiguration.

public void testEndpointConfiguration() throws Exception {
    Endpoint endpoint = getMandatoryBean(Endpoint.class, "endpoint1");
    assertEquals("endpoint URI", "direct://start", endpoint.getEndpointUri());
    DummyBean dummyBean = getMandatoryBean(DummyBean.class, "mybean");
    assertNotNull("The bean should have an endpoint injected", dummyBean.getEndpoint());
    assertEquals("endpoint URI", "direct://start", dummyBean.getEndpoint().getEndpointUri());
    log.debug("Found dummy bean: " + dummyBean);
    MockEndpoint resultEndpoint = getMockEndpoint("mock:end");
    resultEndpoint.expectedBodiesReceived(body);
    // now lets send a message
    template.sendBody("direct:start", body);
    resultEndpoint.assertIsSatisfied();
}
Also used : Endpoint(org.apache.camel.Endpoint) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) DummyBean(org.apache.camel.spring.example.DummyBean)

Aggregations

Endpoint (org.apache.camel.Endpoint)1 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)1 DummyBean (org.apache.camel.spring.example.DummyBean)1