Skip to content

Commit 7fda9c1

Browse files
committed
Polish web containers stop contribution
See gh-8227
1 parent 757aa64 commit 7fda9c1

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

spring-boot/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactoryTests.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ public void startCalledTwice() throws Exception {
170170
assertThat(this.output.toString()).containsOnlyOnce("started on port");
171171
}
172172

173+
@Test
174+
public void stopCalledTwice() throws Exception {
175+
AbstractEmbeddedServletContainerFactory factory = getFactory();
176+
this.container = factory
177+
.getEmbeddedServletContainer(exampleServletRegistration());
178+
this.container.start();
179+
this.container.stop();
180+
this.container.stop();
181+
}
182+
173183
@Test
174184
public void emptyServerWhenPortIsMinusOne() throws Exception {
175185
AbstractEmbeddedServletContainerFactory factory = getFactory();
@@ -311,16 +321,6 @@ public void contextRootPathMustNotBeSlash() throws Exception {
311321
getFactory().setContextPath("/");
312322
}
313323

314-
@Test
315-
public void doubleStop() throws Exception {
316-
AbstractEmbeddedServletContainerFactory factory = getFactory();
317-
this.container = factory
318-
.getEmbeddedServletContainer(exampleServletRegistration());
319-
this.container.start();
320-
this.container.stop();
321-
this.container.stop();
322-
}
323-
324324
@Test
325325
public void multipleConfigurations() throws Exception {
326326
AbstractEmbeddedServletContainerFactory factory = getFactory();

spring-boot/src/test/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public void sslCiphersConfiguration() throws Exception {
144144
}
145145

146146
@Test
147-
public void stopNoStart() throws Exception {
147+
public void stopCalledWithoutStart() throws Exception {
148148
JettyEmbeddedServletContainerFactory factory = getFactory();
149149
this.container = factory
150150
.getEmbeddedServletContainer(exampleServletRegistration());

spring-boot/src/test/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public void startupFailureDoesNotResultInUnstoppedThreadsBeingReported()
353353
}
354354

355355
@Test
356-
public void stopNoStart() throws Exception {
356+
public void stopCalledWithoutStart() throws Exception {
357357
TomcatEmbeddedServletContainerFactory factory = getFactory();
358358
this.container = factory
359359
.getEmbeddedServletContainer(exampleServletRegistration());

0 commit comments

Comments
 (0)