Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jay DeLuca <[email protected]>
  • Loading branch information
zeitlinger and jaydeluca authored Aug 27, 2024
1 parent 3ae01cb commit fc2ab2c
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ void shouldTraceTaskletJobStep() {
span ->
span.hasName("BatchJob taskletJob.step")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
span ->
span.hasName("BatchJob taskletJob.step.Tasklet")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(1))));
}

Expand All @@ -70,6 +72,7 @@ void shouldHandleExceptionInTaskletJobStep() {
span ->
span.hasName("BatchJob taskletJob.step")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
span ->
verifyException(
Expand All @@ -90,6 +93,7 @@ void shouldTraceChunkedItemsJob() {
span ->
span.hasName("BatchJob itemsAndTaskletJob.itemStep.Chunk")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(1));
trace.hasSpansSatisfyingExactly(
span ->
Expand All @@ -99,17 +103,20 @@ void shouldTraceChunkedItemsJob() {
span ->
span.hasName("BatchJob itemsAndTaskletJob.itemStep")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
chunk,
chunk,
chunk,
span ->
span.hasName("BatchJob itemsAndTaskletJob.taskletStep")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
span ->
span.hasName("BatchJob itemsAndTaskletJob.taskletStep.Tasklet")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(5)));
});
}
Expand All @@ -128,18 +135,22 @@ void shouldTraceFlowJob() {
span ->
span.hasName("BatchJob flowJob.flowStep1")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
span ->
span.hasName("BatchJob flowJob.flowStep1.Tasklet")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(1)),
span ->
span.hasName("BatchJob flowJob.flowStep2")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
span ->
span.hasName("BatchJob flowJob.flowStep2.Tasklet")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(3))));
}

Expand Down Expand Up @@ -167,20 +178,23 @@ void shouldTraceSplitFlowJob() {
assertThat(spanData.getName())
.matches("BatchJob splitJob.splitFlowStep[12].Tasklet"))
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(1)),
span ->
span.satisfies(
spanData ->
assertThat(spanData.getName())
.matches("BatchJob splitJob.splitFlowStep[12]"))
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
span ->
span.satisfies(
spanData ->
assertThat(spanData.getName())
.matches("BatchJob splitJob.splitFlowStep[12].Tasklet"))
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(3))));
}

Expand All @@ -198,6 +212,7 @@ void shouldTraceJobWithDecision() {
span ->
span.hasName("BatchJob decisionJob.decisionStepStart")
.hasKind(SpanKind.INTERNAL)
.hasTotalAttributeCount(0)
.hasParent(trace.getSpan(0)),
span ->
span.hasName("BatchJob decisionJob.decisionStepStart.Tasklet")
Expand Down Expand Up @@ -269,6 +284,7 @@ protected boolean hasPartitionManagerStep() {
// should be moved to SpanDataAssert
private static void verifyException(SpanDataAssert span, Throwable exception) {
span.hasStatus(StatusData.error())
.hasTotalAttributeCount(0)
.hasEventsSatisfying(
events ->
assertThat(events.get(0))
Expand Down

0 comments on commit fc2ab2c

Please sign in to comment.