Jersey JUnit Test: @WebListener ServletContextListener not invoked
问题 I created this test in Jersey (from the docs), which works fine, with one problem: the @WebListener ServletContextListener is not being invoked. The Resource classes that I need to test rely on an attribute set on the ServletContext by the ServletContextListener. Can I make sure it is invoked, or can I manipulate the ServletContext in some other way? public class SimpleTest extends JerseyTest { @WebListener public static class AppContextListener implements ServletContextListener { @Override