Fix @RegisterExtension on CliTester
This reverts commit dfa5480c
and rather make the field package private
so that the extension can be registered properly
Closes gh-17266
This commit is contained in:
parent
2d70daf5e0
commit
ea9a0c7839
|
@ -18,6 +18,7 @@ package org.springframework.boot.cli;
|
|||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
|
@ -32,7 +33,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
@ExtendWith(OutputCaptureExtension.class)
|
||||
class ClassLoaderIntegrationTests {
|
||||
|
||||
private final CliTester cli;
|
||||
@RegisterExtension
|
||||
CliTester cli;
|
||||
|
||||
ClassLoaderIntegrationTests(CapturedOutput capturedOutput) {
|
||||
this.cli = new CliTester("src/test/resources/", capturedOutput);
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.springframework.boot.cli;
|
|||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
|
@ -32,7 +33,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
@ExtendWith(OutputCaptureExtension.class)
|
||||
class DirectorySourcesIntegrationTests {
|
||||
|
||||
private final CliTester cli;
|
||||
@RegisterExtension
|
||||
CliTester cli;
|
||||
|
||||
DirectorySourcesIntegrationTests(CapturedOutput capturedOutput) {
|
||||
this.cli = new CliTester("src/test/resources/dir-sample/", capturedOutput);
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.junit.jupiter.api.AfterEach;
|
|||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import org.springframework.boot.cli.command.grab.GrabCommand;
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
|
@ -40,7 +41,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||
@ExtendWith(OutputCaptureExtension.class)
|
||||
class GrabCommandIntegrationTests {
|
||||
|
||||
private final CliTester cli;
|
||||
@RegisterExtension
|
||||
CliTester cli;
|
||||
|
||||
GrabCommandIntegrationTests(CapturedOutput capturedOutput) {
|
||||
this.cli = new CliTester("src/test/resources/grab-samples/", capturedOutput);
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.concurrent.ExecutionException;
|
|||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
|
@ -37,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||
@ExtendWith(OutputCaptureExtension.class)
|
||||
class ReproIntegrationTests {
|
||||
|
||||
private final CliTester cli;
|
||||
@RegisterExtension
|
||||
CliTester cli;
|
||||
|
||||
ReproIntegrationTests(CapturedOutput capturedOutput) {
|
||||
this.cli = new CliTester("src/test/resources/repro-samples/", capturedOutput);
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.junit.jupiter.api.AfterEach;
|
|||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import org.springframework.boot.cli.command.run.RunCommand;
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
|
@ -37,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
@ExtendWith(OutputCaptureExtension.class)
|
||||
class RunCommandIntegrationTests {
|
||||
|
||||
private final CliTester cli;
|
||||
@RegisterExtension
|
||||
CliTester cli;
|
||||
|
||||
RunCommandIntegrationTests(CapturedOutput capturedOutput) {
|
||||
this.cli = new CliTester("src/it/resources/run-command/", capturedOutput);
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.net.URI;
|
|||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
|
@ -39,7 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
@ExtendWith(OutputCaptureExtension.class)
|
||||
class SampleIntegrationTests {
|
||||
|
||||
private final CliTester cli;
|
||||
@RegisterExtension
|
||||
CliTester cli;
|
||||
|
||||
SampleIntegrationTests(CapturedOutput capturedOutput) {
|
||||
this.cli = new CliTester("samples/", capturedOutput);
|
||||
|
|
Loading…
Reference in New Issue