Upgrade tests to Junit5
See gh-14737
This commit is contained in:
@@ -16,25 +16,24 @@
|
||||
|
||||
package sample.batch;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.boot.test.extension.OutputCapture;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class SampleBatchApplicationTests {
|
||||
|
||||
@Rule
|
||||
public OutputCapture outputCapture = new OutputCapture();
|
||||
@RegisterExtension
|
||||
OutputCapture output = new OutputCapture();
|
||||
|
||||
@Test
|
||||
public void testDefaultSettings() {
|
||||
assertThat(SpringApplication
|
||||
.exit(SpringApplication.run(SampleBatchApplication.class))).isEqualTo(0);
|
||||
String output = this.outputCapture.toString();
|
||||
assertThat(output).contains("completed with the following parameters");
|
||||
assertThat(this.output).contains("completed with the following parameters");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user