Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private Optional<Class<?>> findMainClass(Stream<StackFrame> stack) {
public ConfigurableApplicationContext run(String... args) {
Startup startup = Startup.create();
if (this.registerShutdownHook) {
SpringApplication.shutdownHook.enableShutdowHookAddition();
SpringApplication.shutdownHook.enableShutdownHookAddition();
}
DefaultBootstrapContext bootstrapContext = createBootstrapContext();
ConfigurableApplicationContext context = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SpringApplicationShutdownHandlers getHandlers() {
return this.handlers;
}

void enableShutdowHookAddition() {
void enableShutdownHookAddition() {
this.shutdownHookAdditionEnabled = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SpringApplicationShutdownHookTests {
@Test
void shutdownHookIsNotAddedUntilContextIsRegistered() {
TestSpringApplicationShutdownHook shutdownHook = new TestSpringApplicationShutdownHook();
shutdownHook.enableShutdowHookAddition();
shutdownHook.enableShutdownHookAddition();
assertThat(shutdownHook.isRuntimeShutdownHookAdded()).isFalse();
ConfigurableApplicationContext context = new GenericApplicationContext();
shutdownHook.registerApplicationContext(context);
Expand All @@ -61,7 +61,7 @@ void shutdownHookIsNotAddedUntilContextIsRegistered() {
@Test
void shutdownHookIsNotAddedUntilHandlerIsRegistered() {
TestSpringApplicationShutdownHook shutdownHook = new TestSpringApplicationShutdownHook();
shutdownHook.enableShutdowHookAddition();
shutdownHook.enableShutdownHookAddition();
assertThat(shutdownHook.isRuntimeShutdownHookAdded()).isFalse();
shutdownHook.getHandlers().add(() -> {
});
Expand All @@ -74,7 +74,7 @@ void shutdownHookIsNotAddedUntilAdditionIsEnabled() {
shutdownHook.getHandlers().add(() -> {
});
assertThat(shutdownHook.isRuntimeShutdownHookAdded()).isFalse();
shutdownHook.enableShutdowHookAddition();
shutdownHook.enableShutdownHookAddition();
shutdownHook.getHandlers().add(() -> {
});
assertThat(shutdownHook.isRuntimeShutdownHookAdded()).isTrue();
Expand Down