@Test(expected = MissingConfigurationException.class) public void shouldThrowMissingConfigurationExceptionIfHasNoBasePackages() { when(context.getInitParameter(BasicConfiguration.CONTAINER_PROVIDER)).thenReturn(null); config.getBasePackages(); }
public String[] getBasePackages() { String packages = servletContext.getInitParameter(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME); if (packages == null) { throw new MissingConfigurationException(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME + " context-param not found in web.xml. Set this parameter with your base package"); } return packages.trim().split(",\\s*"); }
BasicConfiguration { public String[] getBasePackages() { String packages = servletContext.getInitParameter(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME); if (packages == null) { throw new MissingConfigurationException(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME + " context-param not found in web.xml. Set this parameter with your base package"); } return packages.trim().split(",\\s*"); } }
BasicConfiguration { public String[] getBasePackages() { String packages = servletContext.getInitParameter(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME); if (packages == null) { throw new MissingConfigurationException(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME + " context-param not found in web.xml. Set this parameter with your base package"); } return packages.trim().split(",\\s*"); } BasicConfiguration(ServletContext servletContext); }
BasicConfiguration { public String[] getBasePackages() { String packages = servletContext.getInitParameter(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME); if (packages == null) { throw new MissingConfigurationException(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME + " context-param not found in web.xml. Set this parameter with your base package"); } return packages.trim().split(",\\s*"); } BasicConfiguration(ServletContext servletContext); ContainerProvider getProvider(); boolean hasBasePackages(); String[] getBasePackages(); String getEncoding(); String getWebinfClassesDirectory(); ServletContext getServletContext(); boolean isClasspathScanningEnabled(); }
BasicConfiguration { public String[] getBasePackages() { String packages = servletContext.getInitParameter(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME); if (packages == null) { throw new MissingConfigurationException(BasicConfiguration.BASE_PACKAGES_PARAMETER_NAME + " context-param not found in web.xml. Set this parameter with your base package"); } return packages.trim().split(",\\s*"); } BasicConfiguration(ServletContext servletContext); ContainerProvider getProvider(); boolean hasBasePackages(); String[] getBasePackages(); String getEncoding(); String getWebinfClassesDirectory(); ServletContext getServletContext(); boolean isClasspathScanningEnabled(); static final String CONTAINER_PROVIDER; static final String ENCODING; static final String BASE_PACKAGES_PARAMETER_NAME; static final String SCANNING_PARAM; }