SiteConfig extends Config { public void message(List<String> paths, String... languages) { if (messageConfigured) { throw new Error("site message can only be configured once and must before adding template"); } messageConfigured = true; context.beanFactory.bind(Message.class, null, context.httpServer.siteManager.message); context.httpServer.siteManager.message.load(paths, languages); }  SessionConfig session(); CDNConfig cdn(); void message(List<String> paths, String... languages); void template(String path, Class<?> modelClass); StaticContentConfig staticContent(String path); WebSecurityConfig security();  }
@Test void message() { config.messageConfigured = true; assertThatThrownBy(() -> config.message(Lists.newArrayList())) .hasMessageContaining("be configured once"); }