SystemModule extends Module { void configureSite() { property("sys.session.host").ifPresent(host -> { if ("local".equals(host)) { site().session().local(); } else { site().session().redis(host); } }); property("sys.cdn.host").ifPresent(host -> site().cdn().host(host)); property("sys.security.csp").ifPresent(policy -> site().security().contentSecurityPolicy(policy)); } SystemModule(String propertyFileClasspath);   }
@Test void configureSite() { systemModule.context.propertyManager.properties.set("sys.security.csp", "default-src 'self';"); systemModule.configureSite(); assertThat(systemModule.site().security().interceptor.contentSecurityPolicy).isEqualTo("default-src 'self';"); }