TraceError error = errors.get(0);
assertTrue(error.getMessage().contains("Context not available"));
}
Trace createHttpTrace(int statusCode, boolean available) {
SimpleFrameBuilder builder = new SimpleFrameBuilder();
Operation httpOp = new Operation()
.type(OperationType.HTTP);
httpOp.createMap("request")
.put(OperationFields.URI, "/path?fuu=bar")
.put("method", "GET")
.put(OperationFields.CONTEXT_AVAILABLE, available)
.put("servletName", "My stuff / servlet");
httpOp.createMap("response")
.put("statusCode", statusCode);
builder.enter(httpOp);
Frame httpFrame = builder.exit();
return Trace.newInstance(ApplicationName.valueOf("app"), TraceId.valueOf("0"), httpFrame);
}