Merge branch '2.0.x'

This commit is contained in:
Stephane Nicoll 2018-05-22 13:40:51 +02:00
commit 1ea3e95ff6
10 changed files with 20 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -47,7 +47,7 @@ public class OverrideSourcesTests {
@Test
public void beanInjectedToMainConfiguration() {
this.context = SpringApplication.run(new Class<?>[] { MainConfiguration.class },
new String[] { "--spring.main.web_environment=false" });
new String[] { "--spring.main.web-application-type=none" });
assertThat(this.context.getBean(Service.class).bean.name).isEqualTo("foo");
}
@ -55,7 +55,7 @@ public class OverrideSourcesTests {
public void primaryBeanInjectedProvingSourcesNotOverridden() {
this.context = SpringApplication.run(
new Class<?>[] { MainConfiguration.class, TestConfiguration.class },
new String[] { "--spring.main.web_environment=false",
new String[] { "--spring.main.web-application-type=none",
"--spring.main.sources=org.springframework.boot.OverrideSourcesTests.MainConfiguration" });
assertThat(this.context.getBean(Service.class).bean.name).isEqualTo("bar");
}

View File

@ -77,8 +77,9 @@ public class SimpleMainTests {
private String[] getArgs(String... args) {
List<String> list = new ArrayList<>(Arrays.asList(
"--spring.main.webEnvironment=false", "--spring.main.showBanner=OFF",
"--spring.main.registerShutdownHook=false"));
"--spring.main.web-application-type=none",
"--spring.main.show-banner=OFF",
"--spring.main.register-shutdownHook=false"));
if (args.length > 0) {
list.add("--spring.main.sources="
+ StringUtils.arrayToCommaDelimitedString(args));

View File

@ -1091,7 +1091,7 @@ public class SpringApplicationTests {
@Test
public void nonWebApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() {
ConfigurableApplicationContext context = new SpringApplication(
ExampleConfig.class).run("--spring.main.web-application-type=NONE");
ExampleConfig.class).run("--spring.main.web-application-type=none");
assertThat(context).isNotInstanceOfAny(WebApplicationContext.class,
ReactiveWebApplicationContext.class);
assertThat(context.getEnvironment())

View File

@ -59,7 +59,7 @@ public class SampleAtmosphereApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/chat/websocket")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;

View File

@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/echo/websocket")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;
@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties(
"websocket.uri:ws://localhost:" + this.port + "/reverse")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;

View File

@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/echo/websocket")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;
@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/reverse")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;

View File

@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/echo/websocket")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;
@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties(
"websocket.uri:ws://localhost:" + this.port + "/reverse")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;

View File

@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/echo/websocket")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;
@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/reverse")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;

View File

@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/echo/websocket")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;
@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties(
"websocket.uri:ws://localhost:" + this.port + "/reverse")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;

View File

@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/echo/websocket")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;
@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/reverse")
.run("--spring.main.web_environment=false");
.run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload;