@Test public void onEvent_setsErrorWhenNotAlreadySet() {

  setEventType(RequestEvent.Type.FINISHED);
  setBaseUri("/");
  when(request.getProperty(SpanCustomizer.class.getName())).thenReturn(span);
  Exception error = new Exception();
  when(requestEvent.getException()).thenReturn(error);
  when(request.getProperty("error")).thenReturn(null);
  listener.onEvent(requestEvent);
  verify(request).setProperty("error", error);
}