use of io.opentracing.mock.MockSpan in project motan by weibocom.
the class OpenTracingFilterTest method testException.
@Test
public void testException() {
response.setException(new RuntimeException("in test"));
Response res = OTFilter.filter(refer, request);
assertEquals(response, res);
if (tracer instanceof MockTracer) {
MockSpan span = ((MockTracer) tracer).finishedSpans().get(0);
assertEquals(span.logEntries().size(), 1);
assertTrue("request fail.in test".equals(span.logEntries().get(0).fields().get("event")));
}
}
Aggregations