Merge branch '2.0.x' into 2.1.x

This commit is contained in:
Andy Wilkinson
2019-03-28 09:35:53 +00:00
124 changed files with 412 additions and 411 deletions

View File

@@ -36,21 +36,21 @@ public class LinkTests {
@Test
public void getHrefShouldReturnHref() {
String href = "http://example.com";
String href = "https://example.com";
Link link = new Link(href);
assertThat(link.getHref()).isEqualTo(href);
}
@Test
public void isTemplatedWhenContainsPlaceholderShouldReturnTrue() {
String href = "http://example.com/{path}";
String href = "https://example.com/{path}";
Link link = new Link(href);
assertThat(link.isTemplated()).isTrue();
}
@Test
public void isTemplatedWhenContainsNoPlaceholderShouldReturnFalse() {
String href = "http://example.com/path";
String href = "https://example.com/path";
Link link = new Link(href);
assertThat(link.isTemplated()).isFalse();
}

View File

@@ -79,9 +79,9 @@ public class WebFluxEndpointIntegrationTests extends
load(TestEndpointConfiguration.class, (client) -> client.options().uri("/test")
.accept(MediaType.APPLICATION_JSON)
.header("Access-Control-Request-Method", "POST")
.header("Origin", "http://example.com").exchange().expectStatus().isOk()
.header("Origin", "https://example.com").exchange().expectStatus().isOk()
.expectHeader()
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
.valueEquals("Access-Control-Allow-Origin", "https://example.com")
.expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST"));
}
@@ -124,7 +124,7 @@ public class WebFluxEndpointIntegrationTests extends
Environment environment, WebEndpointDiscoverer endpointDiscoverer,
EndpointMediaTypes endpointMediaTypes) {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.setAllowedOrigins(Arrays.asList("http://example.com"));
corsConfiguration.setAllowedOrigins(Arrays.asList("https://example.com"));
corsConfiguration.setAllowedMethods(Arrays.asList("GET", "POST"));
return new WebFluxEndpointHandlerMapping(
new EndpointMapping(environment.getProperty("endpointPath")),

View File

@@ -88,9 +88,9 @@ public class MvcWebEndpointIntegrationTests extends
load(TestEndpointConfiguration.class, (client) -> client.options().uri("/test")
.accept(MediaType.APPLICATION_JSON)
.header("Access-Control-Request-Method", "POST")
.header("Origin", "http://example.com").exchange().expectStatus().isOk()
.header("Origin", "https://example.com").exchange().expectStatus().isOk()
.expectHeader()
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
.valueEquals("Access-Control-Allow-Origin", "https://example.com")
.expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST"));
}
@@ -149,7 +149,7 @@ public class MvcWebEndpointIntegrationTests extends
Environment environment, WebEndpointDiscoverer endpointDiscoverer,
EndpointMediaTypes endpointMediaTypes) {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.setAllowedOrigins(Arrays.asList("http://example.com"));
corsConfiguration.setAllowedOrigins(Arrays.asList("https://example.com"));
corsConfiguration.setAllowedMethods(Arrays.asList("GET", "POST"));
return new WebMvcEndpointHandlerMapping(
new EndpointMapping(environment.getProperty("endpointPath")),