Altered tests

This commit is contained in:
Marcin Grzejszczak
2016-06-09 21:42:57 +02:00
parent 0f60e5bf67
commit fbfed722c7
2 changed files with 1 additions and 10 deletions

View File

@@ -43,14 +43,6 @@ public class ListOfSpansAssert extends AbstractAssert<ListOfSpansAssert, ListOfS
return new ListOfSpansAssert(actual);
}
public ListOfSpansAssert thereIsOnlyOneServerAndClientSideSpanWhoseParentIdIsEqualTo(long traceId) {
isNotNull();
printSpans();
List<Span> spansWithParentSpanAsRootSpan = this.actual.spans.stream().filter(span -> span.getParents().contains(traceId)).collect(Collectors.toList());
Assertions.assertThat(spansWithParentSpanAsRootSpan).hasSize(2).extracting("spanId").containsOnly(spansWithParentSpanAsRootSpan.get(0).getSpanId());
return this;
}
public ListOfSpansAssert everyParentIdHasItsCorrespondingSpan() {
isNotNull();
printSpans();

View File

@@ -75,7 +75,7 @@ public class TraceZuulIntegrationTests {
then(result.getBody()).isEqualTo("Hello world");
then(this.tracer.getCurrentSpan()).isNull();
then(new ListOfSpans(this.spanAccumulator.getSpans()))
.thereIsOnlyOneServerAndClientSideSpanWhoseParentIdIsEqualTo(span.getTraceId());
.everyParentIdHasItsCorrespondingSpan();
}
@Test
@@ -90,7 +90,6 @@ public class TraceZuulIntegrationTests {
then(result.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
then(this.tracer.getCurrentSpan()).isNull();
then(new ListOfSpans(this.spanAccumulator.getSpans()))
.thereIsOnlyOneServerAndClientSideSpanWhoseParentIdIsEqualTo(span.getTraceId())
.everyParentIdHasItsCorrespondingSpan();
}
}