@Test public void shouldThrowExceptionIfNoConfigFileExists() throws ServletException { given(servletConfig.getInitParameter("configFile")).willReturn(""); try { servlet.init(servletConfig); fail("Should throw IllegalArgumentException if no config file exists."); } catch (IllegalArgumentException e) { } }
@Override public void init(ServletConfig config) throws ServletException { super.init(config); Options options = loadOptions(); invalidConfigurationMessage = validate(options); correctlyConfigured = StringUtils.isEmpty(invalidConfigurationMessage); corsAllowOriginPattern = options.getCorsAllowOriginPattern(); parser = new ConstraintParser(options); logConfigurationStatus(); logCorsStatus(); }
ValidationRulesServlet extends HttpServlet { @Override public void init(ServletConfig config) throws ServletException { super.init(config); Options options = loadOptions(); invalidConfigurationMessage = validate(options); correctlyConfigured = StringUtils.isEmpty(invalidConfigurationMessage); corsAllowOriginPattern = options.getCorsAllowOriginPattern(); parser = new ConstraintParser(options); logConfigurationStatus(); logCorsStatus(); } }
ValidationRulesServlet extends HttpServlet { @Override public void init(ServletConfig config) throws ServletException { super.init(config); Options options = loadOptions(); invalidConfigurationMessage = validate(options); correctlyConfigured = StringUtils.isEmpty(invalidConfigurationMessage); corsAllowOriginPattern = options.getCorsAllowOriginPattern(); parser = new ConstraintParser(options); logConfigurationStatus(); logCorsStatus(); }  }
ValidationRulesServlet extends HttpServlet { @Override public void init(ServletConfig config) throws ServletException { super.init(config); Options options = loadOptions(); invalidConfigurationMessage = validate(options); correctlyConfigured = StringUtils.isEmpty(invalidConfigurationMessage); corsAllowOriginPattern = options.getCorsAllowOriginPattern(); parser = new ConstraintParser(options); logConfigurationStatus(); logCorsStatus(); }  @Override void init(ServletConfig config); }
ValidationRulesServlet extends HttpServlet { @Override public void init(ServletConfig config) throws ServletException { super.init(config); Options options = loadOptions(); invalidConfigurationMessage = validate(options); correctlyConfigured = StringUtils.isEmpty(invalidConfigurationMessage); corsAllowOriginPattern = options.getCorsAllowOriginPattern(); parser = new ConstraintParser(options); logConfigurationStatus(); logCorsStatus(); }  @Override void init(ServletConfig config);  }