use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-apps by kiegroup.
the class TrustyServiceTestUtils method buildTraceEventWithNullType.
public static TraceEvent buildTraceEventWithNullType(String cloudEventId) {
TraceEvent traceEvent = readResource("/events/traceEventWithNullType.json", TraceEvent.class);
setExecutionId(traceEvent, cloudEventId);
return traceEvent;
}
use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-apps by kiegroup.
the class TrustyServiceTestUtils method buildCorrectTraceEvent.
public static TraceEvent buildCorrectTraceEvent(String executionId) {
TraceEvent traceEvent = readResource("/events/correctTraceEvent.json", TraceEvent.class);
setExecutionId(traceEvent, executionId);
return traceEvent;
}
use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-runtimes by kiegroup.
the class DefaultAggregatorTest method testAggregateOnEvaluateDecisionServiceWithListWithMissingAfterEvaluateDecisionEventReturnsNoExecutionStepHierarchy.
@Test
void testAggregateOnEvaluateDecisionServiceWithListWithMissingAfterEvaluateDecisionEventReturnsNoExecutionStepHierarchy() throws IOException {
final DefaultAggregator aggregator = new DefaultAggregator();
final List<EvaluateEvent> events = DecisionTracingTestUtils.readEvaluateEventsFromJsonResource(EVALUATE_DECISION_SERVICE_JSON_RESOURCE).stream().filter(e -> !(e.getType() == EvaluateEventType.AFTER_EVALUATE_DECISION && DECISION_SERVICE_DECISION_ID.equals(e.getNodeId()))).collect(Collectors.toList());
CloudEvent cloudEvent = aggregator.aggregate(model, EVALUATE_DECISION_SERVICE_EXECUTION_ID, events, configBean).orElseThrow(IllegalStateException::new);
TraceEvent traceEvent = assertValidCloudEventAndGetData(cloudEvent, EVALUATE_DECISION_SERVICE_EXECUTION_ID);
assertTraceEventWithNoExecutionStepsHierarchy(traceEvent, 1, 1, 2);
}
use of org.kie.kogito.tracing.event.trace.TraceEvent in project kogito-runtimes by kiegroup.
the class DefaultAggregatorTest method testAggregateOnEvaluateAllWithListWithMissingLastBeforeEvaluateDecisionEventReturnsNoExecutionStepHierarchy.
@Test
void testAggregateOnEvaluateAllWithListWithMissingLastBeforeEvaluateDecisionEventReturnsNoExecutionStepHierarchy() 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 && LAST_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 testAggregateOnEvaluateDecisionServiceWithListWithOnlyFirstEventReturnsNoExecutionSteps.
@Test
void testAggregateOnEvaluateDecisionServiceWithListWithOnlyFirstEventReturnsNoExecutionSteps() throws IOException {
final DefaultAggregator aggregator = new DefaultAggregator();
final List<EvaluateEvent> events = DecisionTracingTestUtils.readEvaluateEventsFromJsonResource(EVALUATE_DECISION_SERVICE_JSON_RESOURCE).stream().limit(1).collect(Collectors.toList());
CloudEvent cloudEvent = aggregator.aggregate(model, EVALUATE_DECISION_SERVICE_EXECUTION_ID, events, configBean).orElseThrow(IllegalStateException::new);
TraceEvent traceEvent = assertValidCloudEventAndGetData(cloudEvent, EVALUATE_DECISION_SERVICE_EXECUTION_ID);
assertTraceEvent(traceEvent, 1, 0, 0);
}
Aggregations