use of org.apache.nifi.processor.util.pattern.TestExceptionHandler.ExternalProcedure in project nifi by apache.
the class TestRollbackOnFailure method processInputs.
private void processInputs(RollbackOnFailure context, Integer[][] inputs, List<Integer> results) {
final ExternalProcedure p = new ExternalProcedure();
final MockComponentLog componentLog = new MockComponentLog("processor-id", this);
final ExceptionHandler<RollbackOnFailure> handler = getContextAwareExceptionHandler(componentLog);
for (Integer[] input : inputs) {
if (!handler.execute(context, input, (in) -> {
results.add(p.divide(in[0], in[1]));
context.proceed();
})) {
continue;
}
assertEquals(input[2], results.get(results.size() - 1));
}
}
Aggregations