Use AssertJ in spring-boot-samples
See gh-5083
This commit is contained in:
@@ -22,8 +22,7 @@ import org.junit.Test;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.test.OutputCapture;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class SampleBatchApplicationTests {
|
||||
|
||||
@@ -32,11 +31,10 @@ public class SampleBatchApplicationTests {
|
||||
|
||||
@Test
|
||||
public void testDefaultSettings() throws Exception {
|
||||
assertEquals(0, SpringApplication
|
||||
.exit(SpringApplication.run(SampleBatchApplication.class)));
|
||||
assertThat(SpringApplication
|
||||
.exit(SpringApplication.run(SampleBatchApplication.class))).isEqualTo(0);
|
||||
String output = this.outputCapture.toString();
|
||||
assertTrue("Wrong output: " + output,
|
||||
output.contains("completed with the following parameters"));
|
||||
assertThat(output).contains("completed with the following parameters");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user