@Test public void createsEverrestConfigurationBasedOnInitParamsFromServletContext() { Map<String, String> initParams = new HashMap<>(); initParams.put("org.everrest.http.method.override", "true"); initParams.put("org.everrest.security", "true"); initParams.put("org.everrest.asynchronous", "true"); initParams.put("org.everrest.asynchronous.service.path", "/xxx"); initParams.put("org.everrest.asynchronous.pool.size", "100"); initParams.put("org.everrest.asynchronous.queue.size", "100"); initParams.put("org.everrest.asynchronous.job.timeout", "60"); initParams.put("org.everrest.core.impl.method.MethodInvokerDecoratorFactory", "SomeDecorator"); initParams.put("org.everrest.normalize.uri", "true"); configureInitParamsInServletContext(initParams); EverrestServletContextInitializer everrestServletContextInitializer = new EverrestServletContextInitializer(servletContext); EverrestConfiguration configuration = everrestServletContextInitializer.createConfiguration(); assertEquals(initParams, configuration.getAllProperties()); }
public EverrestConfiguration createConfiguration() { EverrestConfiguration config = new EverrestConfiguration(); for (String parameterName : getParameterNames()) { config.setProperty(parameterName, getParameter(parameterName)); } return config; }
EverrestServletContextInitializer { public EverrestConfiguration createConfiguration() { EverrestConfiguration config = new EverrestConfiguration(); for (String parameterName : getParameterNames()) { config.setProperty(parameterName, getParameter(parameterName)); } return config; } }
EverrestServletContextInitializer { public EverrestConfiguration createConfiguration() { EverrestConfiguration config = new EverrestConfiguration(); for (String parameterName : getParameterNames()) { config.setProperty(parameterName, getParameter(parameterName)); } return config; } EverrestServletContextInitializer(ServletContext servletContext); }
EverrestServletContextInitializer { public EverrestConfiguration createConfiguration() { EverrestConfiguration config = new EverrestConfiguration(); for (String parameterName : getParameterNames()) { config.setProperty(parameterName, getParameter(parameterName)); } return config; } EverrestServletContextInitializer(ServletContext servletContext); Application getApplication(); EverrestConfiguration createConfiguration(); RequestHandler createRequestHandler(); RequestDispatcher createRequestDispatcher(); ResourceBinder createResourceBinder(); DependencySupplier getDependencySupplier(); ProviderBinder createProviderBinder(); EverrestProcessor createEverrestProcessor(); }
EverrestServletContextInitializer { public EverrestConfiguration createConfiguration() { EverrestConfiguration config = new EverrestConfiguration(); for (String parameterName : getParameterNames()) { config.setProperty(parameterName, getParameter(parameterName)); } return config; } EverrestServletContextInitializer(ServletContext servletContext); Application getApplication(); EverrestConfiguration createConfiguration(); RequestHandler createRequestHandler(); RequestDispatcher createRequestDispatcher(); ResourceBinder createResourceBinder(); DependencySupplier getDependencySupplier(); ProviderBinder createProviderBinder(); EverrestProcessor createEverrestProcessor(); static final String EVERREST_SCAN_COMPONENTS; static final String EVERREST_SCAN_SKIP_PACKAGES; static final String JAXRS_APPLICATION; }