@Test public void testSetUnsecurePathConstraintsWithUnSecure() { final Map<String, Object> config = ImmutableMap.of( RestConfig.AUTHENTICATION_SKIP_PATHS, "/path/1,/path/2"); ConstraintSecurityHandler securityHandler = new TestApp(config).createBasicSecurityHandler(); final List<ConstraintMapping> mappings = securityHandler.getConstraintMappings(); assertThat(mappings.size(), is(3)); assertThat(mappings.get(0).getPathSpec(), is("/*")); assertThat(mappings.get(0).getConstraint().getAuthenticate(), is(true)); assertThat(mappings.get(1).getPathSpec(), is("/path/1")); assertThat(mappings.get(1).getConstraint().getAuthenticate(), is(false)); assertThat(mappings.get(2).getPathSpec(), is("/path/2")); assertThat(mappings.get(2).getConstraint().getAuthenticate(), is(false)); }
protected ConstraintSecurityHandler createBasicSecurityHandler() { return createSecurityHandler(); }
Application { protected ConstraintSecurityHandler createBasicSecurityHandler() { return createSecurityHandler(); } }
Application { protected ConstraintSecurityHandler createBasicSecurityHandler() { return createSecurityHandler(); } Application(T config);  Application(T config, String path); }
Application { protected ConstraintSecurityHandler createBasicSecurityHandler() { return createSecurityHandler(); } Application(T config);  Application(T config, String path); final String getPath(); final Metrics getMetrics(); abstract void setupResources(Configurable<?> config, T appConfig); Map<String,String> getMetricsTags(); Server createServer(); static Map<String, String> parseListToMap(List<String> list); Handler wrapWithGzipHandler(Handler handler); static List<URI> parseListeners(
          List<String> listenersConfig,
          int deprecatedPort,
          List<String> supportedSchemes,
          String defaultScheme
  ); void configureBaseApplication(Configurable<?> config); void configureBaseApplication(Configurable<?> config, Map<String, String> metricTags); T getConfiguration(); void start(); void join(); void stop(); void onShutdown(); }
Application { protected ConstraintSecurityHandler createBasicSecurityHandler() { return createSecurityHandler(); } Application(T config);  Application(T config, String path); final String getPath(); final Metrics getMetrics(); abstract void setupResources(Configurable<?> config, T appConfig); Map<String,String> getMetricsTags(); Server createServer(); static Map<String, String> parseListToMap(List<String> list); Handler wrapWithGzipHandler(Handler handler); static List<URI> parseListeners(
          List<String> listenersConfig,
          int deprecatedPort,
          List<String> supportedSchemes,
          String defaultScheme
  ); void configureBaseApplication(Configurable<?> config); void configureBaseApplication(Configurable<?> config, Map<String, String> metricTags); T getConfiguration(); void start(); void join(); void stop(); void onShutdown();  }