use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-runtimes by kiegroup.
the class DefaultAggregatorTest method testAggregateWithNullListReturnsNotEnoughData.
@Test
void testAggregateWithNullListReturnsNotEnoughData() {
final DefaultAggregator aggregator = new DefaultAggregator();
CloudEvent cloudEvent = aggregator.aggregate(model, EVALUATE_ALL_EXECUTION_ID, null, configBean).orElseThrow(IllegalStateException::new);
TraceEvent traceEvent = assertValidCloudEventAndGetData(cloudEvent, EVALUATE_ALL_EXECUTION_ID);
assertTraceEventWithNotEnoughData(traceEvent);
}
use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-runtimes by kiegroup.
the class DefaultAggregatorTest method testAggregateWithEmptyListReturnsNotEnoughData.
@Test
void testAggregateWithEmptyListReturnsNotEnoughData() {
final DefaultAggregator aggregator = new DefaultAggregator();
CloudEvent cloudEvent = aggregator.aggregate(model, EVALUATE_ALL_EXECUTION_ID, Collections.emptyList(), configBean).orElseThrow(IllegalStateException::new);
TraceEvent traceEvent = assertValidCloudEventAndGetData(cloudEvent, EVALUATE_ALL_EXECUTION_ID);
assertTraceEventWithNotEnoughData(traceEvent);
}
use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-runtimes by kiegroup.
the class DefaultAggregatorTest method testAggregateOnEvaluateAllWithNullModelReturnsDmnModelNotFound.
@Test
void testAggregateOnEvaluateAllWithNullModelReturnsDmnModelNotFound() throws IOException {
final DefaultAggregator aggregator = new DefaultAggregator();
List<EvaluateEvent> events = DecisionTracingTestUtils.readEvaluateEventsFromJsonResource(EVALUATE_ALL_JSON_RESOURCE);
CloudEvent cloudEvent = aggregator.aggregate(null, EVALUATE_ALL_EXECUTION_ID, events, configBean).orElseThrow(IllegalStateException::new);
TraceEvent traceEvent = assertValidCloudEventAndGetData(cloudEvent, EVALUATE_ALL_EXECUTION_ID);
assertTraceEvent(traceEvent, 2, 2, 2);
assertTraceEventInternalMessage(traceEvent, InternalMessageType.DMN_MODEL_NOT_FOUND);
}
use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-runtimes by kiegroup.
the class DefaultAggregatorTest method testAggregateOnEvaluateAllWithListWithMissingFirstBeforeEvaluateDecisionEventReturnsNoExecutionStepHierarchy.
@Test
void testAggregateOnEvaluateAllWithListWithMissingFirstBeforeEvaluateDecisionEventReturnsNoExecutionStepHierarchy() throws IOException {
final DefaultAggregator aggregator = new DefaultAggregator();
final List<EvaluateEvent> events = DecisionTracingTestUtils.readEvaluateEventsFromJsonResource(EVALUATE_ALL_JSON_RESOURCE).stream().filter(e -> !(e.getType() == EvaluateEventType.BEFORE_EVALUATE_DECISION && FIRST_DECISION_NODE_ID.equals(e.getNodeId()))).collect(Collectors.toList());
CloudEvent cloudEvent = aggregator.aggregate(model, EVALUATE_ALL_EXECUTION_ID, events, configBean).orElseThrow(IllegalStateException::new);
TraceEvent traceEvent = assertValidCloudEventAndGetData(cloudEvent, EVALUATE_ALL_EXECUTION_ID);
assertTraceEventWithNoExecutionStepsHierarchy(traceEvent, 2, 2, 6);
}
use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-runtimes by kiegroup.
the class DefaultAggregatorTest method testAggregateOnEvaluateAllWithValidListIsWorking.
@Test
void testAggregateOnEvaluateAllWithValidListIsWorking() throws IOException {
final DefaultAggregator aggregator = new DefaultAggregator();
List<EvaluateEvent> events = DecisionTracingTestUtils.readEvaluateEventsFromJsonResource(EVALUATE_ALL_JSON_RESOURCE);
CloudEvent cloudEvent = aggregator.aggregate(model, EVALUATE_ALL_EXECUTION_ID, events, configBean).orElseThrow(IllegalStateException::new);
TraceEvent traceEvent = assertValidCloudEventAndGetData(cloudEvent, EVALUATE_ALL_EXECUTION_ID);
assertTraceEvent(traceEvent, 2, 2, 2);
}
Aggregations