### Question:
HttpAccessAuditFilter implements Filter { @Override public Promise<Response, NeverThrowsException> filter(Context context, Request request, Handler next) { ClientContext clientContext = context.asContext(ClientContext.class); AccessAuditEventBuilder<?> accessAuditEventBuilder = accessEvent(); accessAuditEventBuilder .eventName("OPENIG-HTTP-ACCESS") .timestamp(time.now()) .transactionIdFromContext(context) .serverFromContext(clientContext) .clientFromContext(clientContext) .httpRequest(clientContext.isSecure(), request.getMethod(), getRequestPath(getURI(context, request)), new Form().fromRequestQuery(request), request.getHeaders().copyAsMultiMapOfStrings()); return next.handle(context, request) .thenOnResult(onResult(context, accessAuditEventBuilder)); } HttpAccessAuditFilter(RequestHandler auditServiceHandler, TimeService time); @Override Promise<Response, NeverThrowsException> filter(Context context, Request request, Handler next);  }### Answer:
@Test public void shouldSendAnAccessEvent() throws Exception { HttpAccessAuditFilter filter = new HttpAccessAuditFilter(reqHandler, time); Handler chfHandler = new ResponseHandler(Status.OK); final Response response = filter.filter(context(), request, chfHandler).get(); assertThat(response.getStatus()).isSameAs(Status.OK); verifyAuditServiceCall(reqHandler, response.getStatus()); }
@Test public void shouldNotSendAnAccessEventOnNullResponse() throws Exception { HttpAccessAuditFilter filter = new HttpAccessAuditFilter(reqHandler, time); filter.filter(context(), request, new ResponseHandler((Response) null)).get(); verifyZeroInteractions(reqHandler); }