use of org.mule.functional.api.component.TestConnectorQueueHandler in project mule by mulesoft.
the class HeisenbergMessageSourceTestCase method sourceFailsOnSuccessBodyCallsOnErrorAndOnTerminate.
@Test
public void sourceFailsOnSuccessBodyCallsOnErrorAndOnTerminate() throws Exception {
startFlow("sourceFailsOnSuccessBodyCallsOnErrorAndOnTerminate");
probe(TIMEOUT_MILLIS, POLL_DELAY_MILLIS, () -> assertState(true, true, true));
assertThat(HeisenbergSource.terminateStatus, is(ERROR_BODY));
assertThat(HeisenbergSource.error, not(empty()));
TestConnectorQueueHandler queueHandler = new TestConnectorQueueHandler(registry);
assertThat(queueHandler.read(OUT, RECEIVE_TIMEOUT).getMessage(), hasPayload(equalTo("Expected.")));
}
use of org.mule.functional.api.component.TestConnectorQueueHandler in project mule by mulesoft.
the class QueueWriterMessageProcessor method initialise.
@Override
public void initialise() throws InitialisationException {
if (attributeEvaluator == null) {
String attribute = content == null ? "#[payload]" : content;
if (contentJavaType != null) {
attributeEvaluator = new AttributeEvaluator(attribute, fromType(contentJavaType));
} else {
attributeEvaluator = new AttributeEvaluator(attribute);
}
}
attributeEvaluator.initialize(expressionManager);
queueHandler = new TestConnectorQueueHandler(registry);
}
use of org.mule.functional.api.component.TestConnectorQueueHandler in project mule by mulesoft.
the class HeisenbergMessageSourceTestCase method sourceFailsOnSuccessParametersCallsOnErrorAndOnTerminate.
@Test
public void sourceFailsOnSuccessParametersCallsOnErrorAndOnTerminate() throws Exception {
startFlow("sourceWithInvalidSuccessParameter");
probe(TIMEOUT_MILLIS, POLL_DELAY_MILLIS, () -> assertState(false, true, true));
assertThat(HeisenbergSource.terminateStatus, is(ERROR_INVOKE));
assertThat(HeisenbergSource.error, not(empty()));
TestConnectorQueueHandler queueHandler = new TestConnectorQueueHandler(registry);
assertThat(queueHandler.read(OUT, RECEIVE_TIMEOUT).getMessage(), hasPayload(equalTo("Expected.")));
}
Aggregations