@Test void testConfigurationCORS1() throws Exception { final TrellisConfiguration config = new YamlConfigurationFactory<>(TrellisConfiguration.class, Validators.newValidator(), Jackson.newMinimalObjectMapper(), "") .build(new File(getClass().getResource("/config1.yml").toURI())); assertTrue(config.getCors().getEnabled(), "CORS not enabled!"); assertTrue(config.getCors().getAllowOrigin().contains("*"), "'*' not in CORS allow-origin!"); assertTrue(config.getCors().getAllowHeaders().contains("Link"), "Link not in CORS allow-headers"); assertTrue(config.getCors().getAllowMethods().contains("PUT"), "PUT not in CORS allow-methods!"); assertTrue(config.getCors().getExposeHeaders().contains("Memento-Datetime"), "memento-datetime missing from CORS expose-headers!"); assertEquals(180, config.getCors().getMaxAge(), "Incorrect max-age value in CORS headers!"); assertTrue(config.getCors().getAllowCredentials(), "Incorrect allow-credentials setting in CORS headers!"); }
@JsonProperty public CORSConfiguration getCors() { return cors; }
TrellisConfiguration extends Configuration { @JsonProperty public CORSConfiguration getCors() { return cors; } }
TrellisConfiguration extends Configuration { @JsonProperty public CORSConfiguration getCors() { return cors; }  }
TrellisConfiguration extends Configuration { @JsonProperty public CORSConfiguration getCors() { return cors; }  @JsonProperty String getBaseUrl(); @JsonProperty void setBaseUrl(final String baseUrl); @JsonProperty String getHubUrl(); @JsonProperty void setHubUrl(final String hubUrl); @JsonProperty void setAssets(final AssetConfiguration assets); @JsonProperty AssetConfiguration getAssets(); @JsonProperty String getDefaultName(); @JsonProperty void setDefaultName(final String name); @JsonAnySetter TrellisConfiguration setAdditionalConfig(final String name, final Object value); @JsonAnyGetter Map<String, Object> any(); @JsonProperty void setCache(final CacheConfiguration cache); @JsonProperty CacheConfiguration getCache(); @JsonProperty void setCors(final CORSConfiguration cors); @JsonProperty CORSConfiguration getCors(); @JsonProperty void setAuth(final AuthConfiguration auth); @JsonProperty AuthConfiguration getAuth(); @JsonProperty void setJsonld(final JsonLdConfiguration jsonld); @JsonProperty JsonLdConfiguration getJsonld(); @JsonProperty void setUseRelativeIris(final boolean useRelativeIris); @JsonProperty boolean getUseRelativeIris(); @JsonProperty void setNotifications(final NotificationsConfiguration notifications); @JsonProperty NotificationsConfiguration getNotifications(); }
TrellisConfiguration extends Configuration { @JsonProperty public CORSConfiguration getCors() { return cors; }  @JsonProperty String getBaseUrl(); @JsonProperty void setBaseUrl(final String baseUrl); @JsonProperty String getHubUrl(); @JsonProperty void setHubUrl(final String hubUrl); @JsonProperty void setAssets(final AssetConfiguration assets); @JsonProperty AssetConfiguration getAssets(); @JsonProperty String getDefaultName(); @JsonProperty void setDefaultName(final String name); @JsonAnySetter TrellisConfiguration setAdditionalConfig(final String name, final Object value); @JsonAnyGetter Map<String, Object> any(); @JsonProperty void setCache(final CacheConfiguration cache); @JsonProperty CacheConfiguration getCache(); @JsonProperty void setCors(final CORSConfiguration cors); @JsonProperty CORSConfiguration getCors(); @JsonProperty void setAuth(final AuthConfiguration auth); @JsonProperty AuthConfiguration getAuth(); @JsonProperty void setJsonld(final JsonLdConfiguration jsonld); @JsonProperty JsonLdConfiguration getJsonld(); @JsonProperty void setUseRelativeIris(final boolean useRelativeIris); @JsonProperty boolean getUseRelativeIris(); @JsonProperty void setNotifications(final NotificationsConfiguration notifications); @JsonProperty NotificationsConfiguration getNotifications();  }