Examples of expectedMinimumMessageCount()


Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

public class DelegateEndpointQuartzTest extends CamelTestSupport {
   
    @Test
    public void testQuartzCronRoute() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(3);
       
        assertMockEndpointsSatisfied();

        JobDetail job = mock.getReceivedExchanges().get(0).getIn().getHeader("jobDetail", JobDetail.class);
        assertNotNull(job);
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

        when(client.reserve(anyInt()))
                .thenReturn(jobMock)
                .thenReturn(null);

        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedMinimumMessageCount(1);
        result.assertIsNotSatisfied(1000);

        verify(client, atLeastOnce()).reserve(anyInt());
        verify(client, atLeast(1)).delete(jobId);
    }
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

    @Test
    public void testDocker() throws Exception {
        template.sendBody("direct:in", "");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1)

        assertMockEndpointsSatisfied(60, TimeUnit.SECONDS);
    }

    @Override
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

        when(client.reserve(anyInt()))
                .thenReturn(jobMock)
                .thenReturn(null);

        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedMinimumMessageCount(1);
        result.expectedBodiesReceived(testMessage);
        result.expectedHeaderReceived(Headers.JOB_ID, jobId);
        result.message(0).header(Headers.JOB_ID).isEqualTo(jobId);
        result.assertIsSatisfied(2000);
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

        when(client.reserve(anyInt()))
                .thenReturn(jobMock)
                .thenReturn(null);

        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedMinimumMessageCount(1);
        result.assertIsNotSatisfied(1000);

        verify(client, atLeastOnce()).reserve(anyInt());
        verify(client).release(jobId, priority, delay);
    }
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

    public void testConsume() throws Exception {
        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection producerConnection = stomp.connectBlocking();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(numberOfMessages);

        for (int i = 0; i < numberOfMessages; i++) {
            StompFrame frame = new StompFrame(SEND);
            frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
            frame.addHeader(MESSAGE_ID, StompFrame.encodeHeader("msg:" + i));
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

    public void testConsume() throws Exception {
        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection producerConnection = stomp.connectBlocking();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(numberOfMessages);

        for (int i = 0; i < numberOfMessages; i++) {
            StompFrame frame = new StompFrame(SEND);
            frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
            frame.addHeader(MESSAGE_ID, StompFrame.encodeHeader("msg:" + i));
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

public class QuartUnderscoreTimerNameTest extends CamelTestSupport {

    @Test
    public void testQuartzCronRouteUnderscore() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

public class QuartzSimpleRouteTest extends CamelTestSupport {

    @Test
    public void testQuartzCronRoute() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(3);

        assertMockEndpointsSatisfied();
        Trigger trigger = mock.getReceivedExchanges().get(0).getIn().getHeader("trigger", Trigger.class);
        Assert.assertThat(trigger instanceof SimpleTrigger, CoreMatchers.is(true));
View Full Code Here

Examples of org.apache.camel.component.mock.MockEndpoint.expectedMinimumMessageCount()

        CamelContext camel = app.getBean("camelContext", CamelContext.class);
        assertNotNull(camel);

        MockEndpoint mock = camel.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedMinimumMessageCount(2);

        mock.assertIsSatisfied();

        app.stop();
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.