Browse Source

Merge branch 'spring-operator-polish-urls-remaining-master'

pull/562/head
Spencer Gibb 6 years ago
parent
commit
577a69865b
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 2
      docs/src/main/asciidoc/spring-cloud-commons.adoc
  2. 12
      spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClientTests.java
  3. 22
      spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClientPropertiesMappingTests.java
  4. 2
      spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java

2
docs/src/main/asciidoc/spring-cloud-commons.adoc

@ -500,7 +500,7 @@ public class MyClass {
} }
public String doStuff() { public String doStuff() {
return restTemplate.getForObject("https://example.com", String.class); return restTemplate.getForObject("http://example.com", String.class);
} }
} }
---- ----

12
spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClientTests.java

@ -38,10 +38,10 @@ import static org.springframework.cloud.client.discovery.composite.CompositeDisc
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(properties = { "spring.application.name=service0", @SpringBootTest(properties = { "spring.application.name=service0",
"spring.cloud.discovery.client.simple.instances.service1[0].uri=http://s1-1:8080", "spring.cloud.discovery.client.simple.instances.service1[0].uri=http://s11:8080",
"spring.cloud.discovery.client.simple.instances.service1[1].uri=https://s1-2:8443", "spring.cloud.discovery.client.simple.instances.service1[1].uri=https://s12:8443",
"spring.cloud.discovery.client.simple.instances.service2[0].uri=https://s2-1:8080", "spring.cloud.discovery.client.simple.instances.service2[0].uri=https://s21:8080",
"spring.cloud.discovery.client.simple.instances.service2[1].uri=https://s2-2:443" }, classes = { "spring.cloud.discovery.client.simple.instances.service2[1].uri=https://s22:443" }, classes = {
CompositeDiscoveryClientTestsConfig.class }) CompositeDiscoveryClientTestsConfig.class })
public class CompositeDiscoveryClientTests { public class CompositeDiscoveryClientTests {
@ -55,9 +55,9 @@ public class CompositeDiscoveryClientTests {
then(this.discoveryClient.getInstances("service1")).hasSize(2); then(this.discoveryClient.getInstances("service1")).hasSize(2);
ServiceInstance s1 = this.discoveryClient.getInstances("service1").get(0); ServiceInstance s1 = this.discoveryClient.getInstances("service1").get(0);
then(s1.getHost()).isEqualTo("s1-1"); then(s1.getHost()).isEqualTo("s11");
then(s1.getPort()).isEqualTo(8080); then(s1.getPort()).isEqualTo(8080);
then(s1.getUri()).isEqualTo(URI.create("http://s1-1:8080")); then(s1.getUri()).isEqualTo(URI.create("http://s11:8080"));
then(s1.isSecure()).isEqualTo(false); then(s1.isSecure()).isEqualTo(false);
} }

22
spring-cloud-commons/src/test/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClientPropertiesMappingTests.java

@ -38,10 +38,10 @@ import static org.assertj.core.api.BDDAssertions.then;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(properties = { "spring.application.name=service0", @SpringBootTest(properties = { "spring.application.name=service0",
"spring.cloud.discovery.client.simple.instances.service1[0].uri=http://s1-1:8080", "spring.cloud.discovery.client.simple.instances.service1[0].uri=http://s11:8080",
"spring.cloud.discovery.client.simple.instances.service1[1].uri=https://s1-2:8443", "spring.cloud.discovery.client.simple.instances.service1[1].uri=https://s12:8443",
"spring.cloud.discovery.client.simple.instances.service2[0].uri=https://s2-1:8080", "spring.cloud.discovery.client.simple.instances.service2[0].uri=https://s21:8080",
"spring.cloud.discovery.client.simple.instances.service2[1].uri=https://s2-2:443" }) "spring.cloud.discovery.client.simple.instances.service2[1].uri=https://s22:443" })
public class SimpleDiscoveryClientPropertiesMappingTests { public class SimpleDiscoveryClientPropertiesMappingTests {
@Autowired @Autowired
@ -54,20 +54,18 @@ public class SimpleDiscoveryClientPropertiesMappingTests {
public void propsShouldGetCleanlyMapped() { public void propsShouldGetCleanlyMapped() {
then(this.props.getInstances().size()).isEqualTo(2); then(this.props.getInstances().size()).isEqualTo(2);
then(this.props.getInstances().get("service1").size()).isEqualTo(2); then(this.props.getInstances().get("service1").size()).isEqualTo(2);
then(this.props.getInstances().get("service1").get(0).getHost()) then(this.props.getInstances().get("service1").get(0).getHost()).isEqualTo("s11");
.isEqualTo("s1-1");
then(this.props.getInstances().get("service1").get(0).getPort()).isEqualTo(8080); then(this.props.getInstances().get("service1").get(0).getPort()).isEqualTo(8080);
then(this.props.getInstances().get("service1").get(0).getUri()) then(this.props.getInstances().get("service1").get(0).getUri())
.isEqualTo(URI.create("http://s1-1:8080")); .isEqualTo(URI.create("http://s11:8080"));
then(this.props.getInstances().get("service1").get(0).isSecure()) then(this.props.getInstances().get("service1").get(0).isSecure())
.isEqualTo(false); .isEqualTo(false);
then(this.props.getInstances().get("service2").size()).isEqualTo(2); then(this.props.getInstances().get("service2").size()).isEqualTo(2);
then(this.props.getInstances().get("service2").get(0).getHost()) then(this.props.getInstances().get("service2").get(0).getHost()).isEqualTo("s21");
.isEqualTo("s2-1");
then(this.props.getInstances().get("service2").get(0).getPort()).isEqualTo(8080); then(this.props.getInstances().get("service2").get(0).getPort()).isEqualTo(8080);
then(this.props.getInstances().get("service2").get(0).getUri()) then(this.props.getInstances().get("service2").get(0).getUri())
.isEqualTo(URI.create("https://s2-1:8080")); .isEqualTo(URI.create("https://s21:8080"));
then(this.props.getInstances().get("service2").get(0).isSecure()).isEqualTo(true); then(this.props.getInstances().get("service2").get(0).isSecure()).isEqualTo(true);
} }
@ -77,9 +75,9 @@ public class SimpleDiscoveryClientPropertiesMappingTests {
then(this.discoveryClient.getInstances("service1")).hasSize(2); then(this.discoveryClient.getInstances("service1")).hasSize(2);
ServiceInstance s1 = this.discoveryClient.getInstances("service1").get(0); ServiceInstance s1 = this.discoveryClient.getInstances("service1").get(0);
then(s1.getHost()).isEqualTo("s1-1"); then(s1.getHost()).isEqualTo("s11");
then(s1.getPort()).isEqualTo(8080); then(s1.getPort()).isEqualTo(8080);
then(s1.getUri()).isEqualTo(URI.create("http://s1-1:8080")); then(s1.getUri()).isEqualTo(URI.create("http://s11:8080"));
then(s1.isSecure()).isEqualTo(false); then(s1.isSecure()).isEqualTo(false);
} }

2
spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java

@ -371,7 +371,7 @@ public class BootstrapConfigurationTests {
} }
@Test @Test
@Ignore //FIXME 2.2.0.M1 @Ignore // FIXME 2.2.0.M1
public void includeProfileFromBootstrapProperties() { public void includeProfileFromBootstrapProperties() {
this.context = new SpringApplicationBuilder().web(WebApplicationType.NONE) this.context = new SpringApplicationBuilder().web(WebApplicationType.NONE)
.sources(BareConfiguration.class) .sources(BareConfiguration.class)

Loading…
Cancel
Save