ServerFactory { public ServerFactory configureServer(final ServerOperator serverLambda) { serverLambdas.add(serverLambda); return this; } ServerFactory(); ServerFactory withCommandlineOptions(final Options options); ServerFactory withCommandlineArgs(final String[] args); ServerFactory withPropertiesFile(final String path); ServerFactory withResource(final String s,
                                      final ResourceConfig resource); HttpServer build(); ServerFactory configureServer(final ServerOperator serverLambda); static final Options CLI_OPTIONS; }
@Test public void testConfigureServer() throws Exception { ServerFactory f = new ServerFactory() .configureServer((s, c) -> { s.getServerConfiguration().setSessionTimeoutSeconds(1000); }); HttpServer s = f.build(); assertEquals(1000, s.getServerConfiguration().getSessionTimeoutSeconds()); }