Skip to content

Commit f52f88b

Browse files
committed
Make interactive mode the default
Closes: gh-1186 Signed-off-by: Andrey Litvitski <[email protected]>
1 parent 328f23a commit f52f88b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/ShellRunnerAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public static class NonePrimaryCommandConfiguration {
6161

6262
@Bean
6363
@ConditionalOnProperty(prefix = "spring.shell.interactive", value = "enabled", havingValue = "true",
64-
matchIfMissing = false)
64+
matchIfMissing = true)
6565
public InteractiveShellRunner interactiveApplicationRunner(LineReader lineReader, PromptProvider promptProvider,
6666
Shell shell, ShellContext shellContext) {
6767
return new InteractiveShellRunner(lineReader, promptProvider, shell, shellContext);
6868
}
6969

7070
@Bean
7171
@ConditionalOnProperty(prefix = "spring.shell.noninteractive", value = "enabled", havingValue = "true",
72-
matchIfMissing = true)
72+
matchIfMissing = false)
7373
public NonInteractiveShellRunner nonInteractiveApplicationRunner(Shell shell, ShellContext shellContext,
7474
ObjectProvider<NonInteractiveShellRunnerCustomizer> customizer) {
7575
NonInteractiveShellRunner shellRunner = new NonInteractiveShellRunner(shell, shellContext);

spring-shell-autoconfigure/src/test/java/org/springframework/shell/boot/ShellRunnerAutoConfigurationTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ class ShellRunnerAutoConfigurationTests {
5555
@Nested
5656
class Interactive {
5757

58+
@Test
59+
void enabledByDefault() {
60+
contextRunner.run(context -> assertThat(context).hasSingleBean(InteractiveShellRunner.class));
61+
}
62+
5863
@Test
5964
void disabledByDefault() {
6065
contextRunner.run(context -> assertThat(context).doesNotHaveBean(InteractiveShellRunner.class));
@@ -71,11 +76,6 @@ void disabledWhenPropertySet() {
7176
@Nested
7277
class NonInteractive {
7378

74-
@Test
75-
void enabledByDefault() {
76-
contextRunner.run(context -> assertThat(context).hasSingleBean(NonInteractiveShellRunner.class));
77-
}
78-
7979
@Test
8080
void primaryCommandNotSet() {
8181
contextRunner.run(context -> {

0 commit comments

Comments
 (0)