use of org.camunda.bpm.dmn.engine.spi.DmnEngineMetricCollector in project camunda-engine-dmn by camunda.
the class DmnEngineMetricCollectorTest method testCustomEngineMetricCollector.
@Test
public void testCustomEngineMetricCollector() {
DmnEngineConfiguration configuration = DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
DmnEngineMetricCollector mockMetricCollector = mock(DmnEngineMetricCollector.class);
configuration.setEngineMetricCollector(mockMetricCollector);
DmnEngine engine = configuration.buildEngine();
// evaluate one decision table
engine.evaluateDecisionTable(parseDecisionFromFile("decision", EXAMPLE_DMN), variables);
verify(mockMetricCollector, times(1)).notify(any(DmnDecisionTableEvaluationEvent.class));
// evaluate one decision literal expression
engine.evaluateDecision(parseDecisionFromFile("c", DRG_WITH_LITERAL_EXPRESSIONS), variables);
verify(mockMetricCollector, times(1)).notify(any(DmnDecisionTableEvaluationEvent.class));
}
Aggregations