Search in sources :

Example 1 with ResponseAssertionMessageProcessor

use of org.mule.functional.api.component.ResponseAssertionMessageProcessor in project mule by mulesoft.

the class ResponseAssertionMessageProcessorTestCase method responseProcessNonBlocking.

@Test
public void responseProcessNonBlocking() throws Exception {
    when(mockEvent.getError()).thenReturn(empty());
    ResponseAssertionMessageProcessor asp = createAssertionMessageProcessor();
    asp.setListener(testNonBlockingProcessor);
    asp.setExpressionManager(expressionManager);
    asp.setAnnotations(singletonMap(LOCATION_KEY, fromSingleComponent("flow")));
    asp.setExpression(TRUE_EXPRESSION);
    asp.setResponseExpression(TRUE_EXPRESSION);
    asp.setCount(1);
    asp.setResponseCount(1);
    asp.setResponseSameTask(false);
    asp.start();
    asp.process(mockEvent);
    assertFalse(asp.expressionFailed());
    assertFalse(asp.responseExpressionFailed());
    assertFalse(asp.countFailOrNullEvent());
    assertFalse(asp.responseCountFailOrNullEvent());
}
Also used : ResponseAssertionMessageProcessor(org.mule.functional.api.component.ResponseAssertionMessageProcessor) Test(org.junit.Test)

Example 2 with ResponseAssertionMessageProcessor

use of org.mule.functional.api.component.ResponseAssertionMessageProcessor in project mule by mulesoft.

the class ResponseAssertionMessageProcessorTestCase method createAssertionMessageProcessor.

@Override
protected ResponseAssertionMessageProcessor createAssertionMessageProcessor() {
    ResponseAssertionMessageProcessor mp = new ResponseAssertionMessageProcessor();
    mp.setListener(new SensingNullMessageProcessor());
    return mp;
}
Also used : ResponseAssertionMessageProcessor(org.mule.functional.api.component.ResponseAssertionMessageProcessor) SensingNullMessageProcessor(org.mule.tck.SensingNullMessageProcessor)

Example 3 with ResponseAssertionMessageProcessor

use of org.mule.functional.api.component.ResponseAssertionMessageProcessor in project mule by mulesoft.

the class ResponseAssertionMessageProcessorTestCase method responseProcess.

@Test
public void responseProcess() throws Exception {
    ResponseAssertionMessageProcessor asp = createAssertionMessageProcessor();
    asp.setListener(testNonBlockingProcessor);
    asp.setExpressionManager(expressionManager);
    asp.setAnnotations(singletonMap(LOCATION_KEY, fromSingleComponent("flow")));
    asp.setExpression(TRUE_EXPRESSION);
    asp.setResponseExpression(TRUE_EXPRESSION);
    asp.setCount(1);
    asp.setResponseCount(1);
    asp.setResponseSameTask(false);
    asp.start();
    asp.process(mockEvent);
    assertFalse(asp.expressionFailed());
    assertFalse(asp.responseExpressionFailed());
    assertFalse(asp.countFailOrNullEvent());
    assertFalse(asp.responseCountFailOrNullEvent());
}
Also used : ResponseAssertionMessageProcessor(org.mule.functional.api.component.ResponseAssertionMessageProcessor) Test(org.junit.Test)

Aggregations

ResponseAssertionMessageProcessor (org.mule.functional.api.component.ResponseAssertionMessageProcessor)3 Test (org.junit.Test)2 SensingNullMessageProcessor (org.mule.tck.SensingNullMessageProcessor)1