Commit d5abd57a authored by Stephane Nicoll's avatar Stephane Nicoll

Remove deprecated use of spring.main.web-environment

Closes gh-13231
parent a124379d
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -47,7 +47,7 @@ public class OverrideSourcesTests { ...@@ -47,7 +47,7 @@ public class OverrideSourcesTests {
@Test @Test
public void beanInjectedToMainConfiguration() { public void beanInjectedToMainConfiguration() {
this.context = SpringApplication.run(new Class<?>[] { MainConfiguration.class }, 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"); assertThat(this.context.getBean(Service.class).bean.name).isEqualTo("foo");
} }
...@@ -55,7 +55,7 @@ public class OverrideSourcesTests { ...@@ -55,7 +55,7 @@ public class OverrideSourcesTests {
public void primaryBeanInjectedProvingSourcesNotOverridden() { public void primaryBeanInjectedProvingSourcesNotOverridden() {
this.context = SpringApplication.run( this.context = SpringApplication.run(
new Class<?>[] { MainConfiguration.class, TestConfiguration.class }, 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" }); "--spring.main.sources=org.springframework.boot.OverrideSourcesTests.MainConfiguration" });
assertThat(this.context.getBean(Service.class).bean.name).isEqualTo("bar"); assertThat(this.context.getBean(Service.class).bean.name).isEqualTo("bar");
} }
......
...@@ -77,7 +77,7 @@ public class SimpleMainTests { ...@@ -77,7 +77,7 @@ public class SimpleMainTests {
private String[] getArgs(String... args) { private String[] getArgs(String... args) {
List<String> list = new ArrayList<>(Arrays.asList( List<String> list = new ArrayList<>(Arrays.asList(
"--spring.main.webEnvironment=false", "--spring.main.showBanner=OFF", "--spring.main.web-application-type=none", "--spring.main.showBanner=OFF",
"--spring.main.registerShutdownHook=false")); "--spring.main.registerShutdownHook=false"));
if (args.length > 0) { if (args.length > 0) {
list.add("--spring.main.sources=" list.add("--spring.main.sources="
......
...@@ -1091,7 +1091,7 @@ public class SpringApplicationTests { ...@@ -1091,7 +1091,7 @@ public class SpringApplicationTests {
@Test @Test
public void nonWebApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() { public void nonWebApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() {
ConfigurableApplicationContext context = new SpringApplication( 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, assertThat(context).isNotInstanceOfAny(WebApplicationContext.class,
ReactiveWebApplicationContext.class); ReactiveWebApplicationContext.class);
assertThat(context.getEnvironment()) assertThat(context.getEnvironment())
......
...@@ -59,7 +59,7 @@ public class SampleAtmosphereApplicationTests { ...@@ -59,7 +59,7 @@ public class SampleAtmosphereApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/chat/websocket") + "/chat/websocket")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
......
...@@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests { ...@@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/echo/websocket") + "/echo/websocket")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
...@@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests { ...@@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties( .properties(
"websocket.uri:ws://localhost:" + this.port + "/reverse") "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(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
......
...@@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests { ...@@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/echo/websocket") + "/ws/echo/websocket")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
...@@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests { ...@@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/reverse") + "/ws/reverse")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
......
...@@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests { ...@@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/echo/websocket") + "/echo/websocket")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
...@@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests { ...@@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties( .properties(
"websocket.uri:ws://localhost:" + this.port + "/reverse") "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(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
......
...@@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests { ...@@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/echo/websocket") + "/ws/echo/websocket")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
...@@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests { ...@@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/reverse") + "/ws/reverse")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
......
...@@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests { ...@@ -59,7 +59,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/echo/websocket") + "/echo/websocket")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
...@@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests { ...@@ -75,7 +75,7 @@ public class SampleWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties( .properties(
"websocket.uri:ws://localhost:" + this.port + "/reverse") "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(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
......
...@@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests { ...@@ -65,7 +65,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/echo/websocket") + "/ws/echo/websocket")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
...@@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests { ...@@ -81,7 +81,7 @@ public class CustomContainerWebSocketsApplicationTests {
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class) ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port .properties("websocket.uri:ws://localhost:" + this.port
+ "/ws/reverse") + "/ws/reverse")
.run("--spring.main.web_environment=false"); .run("--spring.main.web-application-type=none");
long count = context.getBean(ClientConfiguration.class).latch.getCount(); long count = context.getBean(ClientConfiguration.class).latch.getCount();
AtomicReference<String> messagePayloadReference = context AtomicReference<String> messagePayloadReference = context
.getBean(ClientConfiguration.class).messagePayload; .getBean(ClientConfiguration.class).messagePayload;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment