@Test
public void stopsEverrestProcessorWhenServletContextDestroyed() throws Exception {

    EverrestProcessor everrestProcessor = mock(EverrestProcessor.class);
    when(servletContext.getAttribute(EverrestProcessor.class.getName())).thenReturn(everrestProcessor);
    EverrestInitializedListener everrestInitializedListener = new EverrestInitializedListener();
    ServletContextEvent servletContextEvent = new ServletContextEvent(servletContext);
    everrestInitializedListener.contextDestroyed(servletContextEvent);
    verify(everrestProcessor).stop();
}