@Test public void shouldExecuteHappyPath() throws IOException, ServletException { filter.doFilter(request, response, chain); verify(facade).initializeRequest(request); verify(chain).doFilter(request, response); verify(facade, never()).send((Throwable) anyObject()); verify(facade).done(); }
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { try { if (servletRequest instanceof HttpServletRequest) { raygunServletFilterFacade.initializeRequest((HttpServletRequest)servletRequest); } filterChain.doFilter(servletRequest, servletResponse); } catch (Throwable ex) { if (servletResponse instanceof HttpServletResponse) { raygunServletFilterFacade.setCommittedResponse((HttpServletResponse) servletResponse); } raygunServletFilterFacade.sendUnhandled(ex); if (ex instanceof ServletException) throw (ServletException)ex; if (ex instanceof IOException) throw (IOException)ex; if (ex instanceof RuntimeException) throw (RuntimeException)ex; throw new ServletException(ex); } finally { raygunServletFilterFacade.done(); } }
RaygunServletFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { try { if (servletRequest instanceof HttpServletRequest) { raygunServletFilterFacade.initializeRequest((HttpServletRequest)servletRequest); } filterChain.doFilter(servletRequest, servletResponse); } catch (Throwable ex) { if (servletResponse instanceof HttpServletResponse) { raygunServletFilterFacade.setCommittedResponse((HttpServletResponse) servletResponse); } raygunServletFilterFacade.sendUnhandled(ex); if (ex instanceof ServletException) throw (ServletException)ex; if (ex instanceof IOException) throw (IOException)ex; if (ex instanceof RuntimeException) throw (RuntimeException)ex; throw new ServletException(ex); } finally { raygunServletFilterFacade.done(); } } }
RaygunServletFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { try { if (servletRequest instanceof HttpServletRequest) { raygunServletFilterFacade.initializeRequest((HttpServletRequest)servletRequest); } filterChain.doFilter(servletRequest, servletResponse); } catch (Throwable ex) { if (servletResponse instanceof HttpServletResponse) { raygunServletFilterFacade.setCommittedResponse((HttpServletResponse) servletResponse); } raygunServletFilterFacade.sendUnhandled(ex); if (ex instanceof ServletException) throw (ServletException)ex; if (ex instanceof IOException) throw (IOException)ex; if (ex instanceof RuntimeException) throw (RuntimeException)ex; throw new ServletException(ex); } finally { raygunServletFilterFacade.done(); } } RaygunServletFilter(IRaygunServletFilterFacade raygunServletFilterFacade); }
RaygunServletFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { try { if (servletRequest instanceof HttpServletRequest) { raygunServletFilterFacade.initializeRequest((HttpServletRequest)servletRequest); } filterChain.doFilter(servletRequest, servletResponse); } catch (Throwable ex) { if (servletResponse instanceof HttpServletResponse) { raygunServletFilterFacade.setCommittedResponse((HttpServletResponse) servletResponse); } raygunServletFilterFacade.sendUnhandled(ex); if (ex instanceof ServletException) throw (ServletException)ex; if (ex instanceof IOException) throw (IOException)ex; if (ex instanceof RuntimeException) throw (RuntimeException)ex; throw new ServletException(ex); } finally { raygunServletFilterFacade.done(); } } RaygunServletFilter(IRaygunServletFilterFacade raygunServletFilterFacade); void init(FilterConfig filterConfig); void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain); void destroy(); }
RaygunServletFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { try { if (servletRequest instanceof HttpServletRequest) { raygunServletFilterFacade.initializeRequest((HttpServletRequest)servletRequest); } filterChain.doFilter(servletRequest, servletResponse); } catch (Throwable ex) { if (servletResponse instanceof HttpServletResponse) { raygunServletFilterFacade.setCommittedResponse((HttpServletResponse) servletResponse); } raygunServletFilterFacade.sendUnhandled(ex); if (ex instanceof ServletException) throw (ServletException)ex; if (ex instanceof IOException) throw (IOException)ex; if (ex instanceof RuntimeException) throw (RuntimeException)ex; throw new ServletException(ex); } finally { raygunServletFilterFacade.done(); } } RaygunServletFilter(IRaygunServletFilterFacade raygunServletFilterFacade); void init(FilterConfig filterConfig); void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain); void destroy();  }