Modified a test to present better output

This commit is contained in:
Marcin Grzejszczak
2017-11-15 17:18:00 +01:00
parent ab2ccf2562
commit 1ab3870d43

View File

@@ -107,8 +107,16 @@ public class MessagingApplicationTests extends AbstractIntegrationTest {
private void thenAllSpansHaveTraceIdEqualTo(long traceId) {
String traceIdHex = Long.toHexString(traceId);
then(this.integrationTestSpanCollector.hashedSpans.stream()
.allMatch(span -> span.traceId().equals(traceIdHex))).describedAs("All spans have same trace id").isTrue();
log.info("Stored spans: [\n" + this.integrationTestSpanCollector.hashedSpans
.stream()
.map(Span::toString)
.collect(Collectors.joining("\n")) + "\n]");
then(this.integrationTestSpanCollector.hashedSpans
.stream()
.filter(span -> !span.traceId().equals(traceIdHex))
.collect(Collectors.toList()))
.describedAs("All spans have same trace id [" + traceIdHex + "]")
.isEmpty();
}
private void thenTheSpansHaveProperParentStructure() {