Use AssertJ in spring-boot-samples
See gh-5083
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
|
||||
package sample.ant;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
@@ -48,12 +46,12 @@ public class SampleAntApplicationIT {
|
||||
}
|
||||
|
||||
});
|
||||
assertThat("Number of jars", jarFiles.length, equalTo(1));
|
||||
assertThat(jarFiles).hasSize(1);
|
||||
Process process = new JavaExecutable().processBuilder("-jar", jarFiles[0].getName()).directory(target).start();
|
||||
process.waitFor(5, TimeUnit.MINUTES);
|
||||
assertThat(process.exitValue(), equalTo(0));
|
||||
assertThat(process.exitValue()).isEqualTo(0);
|
||||
String output = FileCopyUtils.copyToString(new InputStreamReader(process.getInputStream()));
|
||||
assertThat(output, containsString("Spring Boot Ant Example"));
|
||||
assertThat(output).contains("Spring Boot Ant Example");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user