Skip to content

Commit 82699f2

Browse files
committed
Remove test dependency to spring-boot-test in spring-shell-core
The core module should not depend on Spring Boot both in production and test dependencies.
1 parent bcf1026 commit 82699f2

File tree

6 files changed

+7
-19
lines changed

6 files changed

+7
-19
lines changed

spring-shell-autoconfigure/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<dependencies>
3434
<dependency>
3535
<groupId>org.springframework.shell</groupId>
36-
<artifactId>spring-shell-standard</artifactId>
36+
<artifactId>spring-shell-core</artifactId>
3737
<version>${project.parent.version}</version>
3838
</dependency>
3939
<dependency>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.shell.core.command.annotation.support;
16+
package org.springframework.shell.boot;
1717

1818
import java.util.Collections;
1919

@@ -22,6 +22,7 @@
2222

2323
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2424
import org.springframework.context.annotation.Bean;
25+
import org.springframework.shell.core.command.annotation.support.CommandRegistrationFactoryBean;
2526
import org.springframework.shell.core.command.availability.Availability;
2627
import org.springframework.shell.core.command.availability.AvailabilityProvider;
2728
import org.springframework.shell.core.command.CommandRegistration;

spring-shell-core/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@
7474

7575
<!-- Test dependencies -->
7676
<dependency>
77-
<groupId>org.springframework.boot</groupId>
78-
<artifactId>spring-boot-test</artifactId>
79-
<version>${spring-boot.version}</version>
77+
<groupId>org.springframework</groupId>
78+
<artifactId>spring-test</artifactId>
79+
<version>${spring-framework.version}</version>
8080
<scope>test</scope>
8181
</dependency>
8282
<dependency>

spring-shell-core/src/main/java/org/springframework/shell/core/command/annotation/support/CommandRegistrationFactoryBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
* @author Janne Valkealahti
7575
* @author Piotr Olaszewski
7676
*/
77-
class CommandRegistrationFactoryBean
77+
public class CommandRegistrationFactoryBean
7878
implements FactoryBean<CommandRegistration>, ApplicationContextAware, InitializingBean {
7979

8080
private final Log log = LogFactory.getLog(CommandRegistrationFactoryBean.class);

spring-shell-core/src/test/java/org/springframework/shell/core/jline/NonInteractiveShellRunnerTests.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@
2323
import org.mockito.Spy;
2424
import org.mockito.junit.jupiter.MockitoExtension;
2525

26-
import org.springframework.boot.ApplicationArguments;
27-
import org.springframework.boot.DefaultApplicationArguments;
2826
import org.springframework.shell.core.InputProvider;
2927
import org.springframework.shell.core.Shell;
3028
import org.springframework.shell.core.context.DefaultShellContext;
31-
import org.springframework.shell.core.jline.NonInteractiveShellRunner;
3229

3330
import static org.assertj.core.api.Assertions.*;
3431

@@ -85,10 +82,6 @@ void shouldNotQuoteWithoutWhitespace() throws Exception {
8582
assertThat(value.readInput().rawText()).isEqualTo("foobar");
8683
}
8784

88-
private static ApplicationArguments ofApplicationArguments(String... args) {
89-
return new DefaultApplicationArguments(args);
90-
}
91-
9285
private static String[] ofArgs(String... args) {
9386
String[] a = new String[args.length];
9487
for (int i = 0; i < args.length; i++) {

spring-shell-core/src/test/java/org/springframework/shell/core/jline/ScriptShellRunnerTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import org.mockito.Mockito;
2626
import org.mockito.junit.jupiter.MockitoExtension;
2727

28-
import org.springframework.boot.ApplicationArguments;
29-
import org.springframework.boot.DefaultApplicationArguments;
3028
import org.springframework.shell.core.Shell;
3129

3230
@ExtendWith(MockitoExtension.class)
@@ -64,10 +62,6 @@ void shouldRunWhenFirstArgHavingFile(@TempDir Path workingDir) throws Exception
6462
shellRunner.run(new String[] { "@" + pathStr });
6563
}
6664

67-
private static ApplicationArguments ofApplicationArguments(String... args) {
68-
return new DefaultApplicationArguments(args);
69-
}
70-
7165
private static String[] ofArgs(String... args) {
7266
String[] a = new String[args.length];
7367
for (int i = 0; i < args.length; i++) {

0 commit comments

Comments
 (0)