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());
}
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;
}
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());
}
Aggregations