Polish output capture names
This commit is contained in:
@@ -39,10 +39,10 @@ class SampleActiveMqTests {
|
||||
private Producer producer;
|
||||
|
||||
@Test
|
||||
void sendSimpleMessage(CapturedOutput capturedOutput) throws InterruptedException {
|
||||
void sendSimpleMessage(CapturedOutput output) throws InterruptedException {
|
||||
this.producer.send("Test message");
|
||||
Thread.sleep(1000L);
|
||||
assertThat(capturedOutput).contains("Test message");
|
||||
assertThat(output).contains("Test message");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,9 +52,9 @@ class SampleActuatorLog4J2ApplicationTests {
|
||||
private MockMvc mvc;
|
||||
|
||||
@Test
|
||||
void testLogger(CapturedOutput capturedOutput) {
|
||||
void testLogger(CapturedOutput output) {
|
||||
logger.info("Hello World");
|
||||
assertThat(capturedOutput).contains("Hello World");
|
||||
assertThat(output).contains("Hello World");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -53,15 +53,15 @@ class SampleAopApplicationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) throws Exception {
|
||||
void testDefaultSettings(CapturedOutput output) throws Exception {
|
||||
SampleAopApplication.main(new String[0]);
|
||||
assertThat(capturedOutput).contains("Hello Phil");
|
||||
assertThat(output).contains("Hello Phil");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCommandLineOverrides(CapturedOutput capturedOutput) throws Exception {
|
||||
void testCommandLineOverrides(CapturedOutput output) throws Exception {
|
||||
SampleAopApplication.main(new String[] { "--name=Gordon" });
|
||||
assertThat(capturedOutput).contains("Hello Gordon");
|
||||
assertThat(output).contains("Hello Gordon");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleBatchApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) {
|
||||
void testDefaultSettings(CapturedOutput output) {
|
||||
assertThat(SpringApplication.exit(SpringApplication.run(SampleBatchApplication.class))).isEqualTo(0);
|
||||
assertThat(capturedOutput).contains("completed with the following parameters");
|
||||
assertThat(output).contains("completed with the following parameters");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleCouchbaseApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) {
|
||||
void testDefaultSettings(CapturedOutput output) {
|
||||
try {
|
||||
new SpringApplicationBuilder(SampleCouchbaseApplication.class).run("--server.port=0");
|
||||
}
|
||||
@@ -40,7 +40,7 @@ class SampleCouchbaseApplicationTests {
|
||||
return;
|
||||
}
|
||||
}
|
||||
assertThat(capturedOutput).contains("firstName='Alice', lastName='Smith'");
|
||||
assertThat(output).contains("firstName='Alice', lastName='Smith'");
|
||||
}
|
||||
|
||||
private boolean serverNotRunning(RuntimeException ex) {
|
||||
|
||||
@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleElasticsearchApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) {
|
||||
void testDefaultSettings(CapturedOutput output) {
|
||||
try {
|
||||
new SpringApplicationBuilder(SampleElasticsearchApplication.class).run();
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class SampleElasticsearchApplicationTests {
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
assertThat(capturedOutput).contains("firstName='Alice', lastName='Smith'");
|
||||
assertThat(output).contains("firstName='Alice', lastName='Smith'");
|
||||
}
|
||||
|
||||
private boolean elasticsearchRunning(Exception ex) {
|
||||
|
||||
@@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleNeo4jApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) {
|
||||
void testDefaultSettings(CapturedOutput output) {
|
||||
try {
|
||||
SampleNeo4jApplication.main(new String[0]);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class SampleNeo4jApplicationTests {
|
||||
return;
|
||||
}
|
||||
}
|
||||
assertThat(capturedOutput).contains("firstName='Alice', lastName='Smith'");
|
||||
assertThat(output).contains("firstName='Alice', lastName='Smith'");
|
||||
}
|
||||
|
||||
private boolean neo4jServerRunning(Throwable ex) {
|
||||
|
||||
@@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleRedisApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) {
|
||||
void testDefaultSettings(CapturedOutput output) {
|
||||
try {
|
||||
SampleRedisApplication.main(new String[0]);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class SampleRedisApplicationTests {
|
||||
return;
|
||||
}
|
||||
}
|
||||
assertThat(capturedOutput).contains("Found key spring.boot.redis.test");
|
||||
assertThat(output).contains("Found key spring.boot.redis.test");
|
||||
}
|
||||
|
||||
private boolean redisServerRunning(Throwable ex) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleSolrApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) throws Exception {
|
||||
void testDefaultSettings(CapturedOutput output) throws Exception {
|
||||
try {
|
||||
SampleSolrApplication.main(new String[0]);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class SampleSolrApplicationTests {
|
||||
return;
|
||||
}
|
||||
}
|
||||
assertThat(capturedOutput).contains("name=Sony Playstation");
|
||||
assertThat(output).contains("name=Sony Playstation");
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
|
||||
@@ -33,9 +33,9 @@ class SampleJooqApplicationTests {
|
||||
private static final String[] NO_ARGS = {};
|
||||
|
||||
@Test
|
||||
void outputResults(CapturedOutput capturedOutput) {
|
||||
void outputResults(CapturedOutput output) {
|
||||
SampleJooqApplication.main(NO_ARGS);
|
||||
assertThat(capturedOutput).contains("jOOQ Fetch 1 Greg Turnquest").contains("jOOQ Fetch 2 Craig Walls")
|
||||
assertThat(output).contains("jOOQ Fetch 1 Greg Turnquest").contains("jOOQ Fetch 2 Craig Walls")
|
||||
.contains("jOOQ SQL " + "[Learning Spring Boot : Greg Turnquest, "
|
||||
+ "Spring Boot in Action : Craig Walls]");
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleAtomikosApplicationTests {
|
||||
|
||||
@Test
|
||||
void testTransactionRollback(CapturedOutput capturedOutput) throws Exception {
|
||||
void testTransactionRollback(CapturedOutput output) throws Exception {
|
||||
SampleAtomikosApplication.main(new String[] {});
|
||||
assertThat(capturedOutput.toString()).has(substring(1, "---->")).has(substring(1, "----> josh"))
|
||||
assertThat(output.toString()).has(substring(1, "---->")).has(substring(1, "----> josh"))
|
||||
.has(substring(2, "Count is 1")).has(substring(1, "Simulated error"));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleBitronixApplicationTests {
|
||||
|
||||
@Test
|
||||
void testTransactionRollback(CapturedOutput capturedOutput) throws Exception {
|
||||
void testTransactionRollback(CapturedOutput output) throws Exception {
|
||||
SampleBitronixApplication.main(new String[] {});
|
||||
assertThat(capturedOutput.toString()).has(substring(1, "---->")).has(substring(1, "----> josh"))
|
||||
assertThat(output.toString()).has(substring(1, "---->")).has(substring(1, "----> josh"))
|
||||
.has(substring(2, "Count is 1")).has(substring(1, "Simulated error"));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleLiquibaseApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) throws Exception {
|
||||
void testDefaultSettings(CapturedOutput output) throws Exception {
|
||||
try {
|
||||
SampleLiquibaseApplication.main(new String[] { "--server.port=0" });
|
||||
}
|
||||
@@ -40,7 +40,7 @@ class SampleLiquibaseApplicationTests {
|
||||
return;
|
||||
}
|
||||
}
|
||||
assertThat(capturedOutput).contains("Successfully acquired change log lock")
|
||||
assertThat(output).contains("Successfully acquired change log lock")
|
||||
.contains("Creating database history " + "table with name: PUBLIC.DATABASECHANGELOG")
|
||||
.contains("Table person created")
|
||||
.contains("ChangeSet classpath:/db/" + "changelog/db.changelog-master.yaml::1::"
|
||||
|
||||
@@ -28,15 +28,15 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleLogbackApplicationTests {
|
||||
|
||||
@Test
|
||||
void testLoadedCustomLogbackConfig(CapturedOutput capturedOutput) throws Exception {
|
||||
void testLoadedCustomLogbackConfig(CapturedOutput output) throws Exception {
|
||||
SampleLogbackApplication.main(new String[0]);
|
||||
assertThat(capturedOutput).contains("Sample Debug Message").doesNotContain("Sample Trace Message");
|
||||
assertThat(output).contains("Sample Debug Message").doesNotContain("Sample Trace Message");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testProfile(CapturedOutput capturedOutput) throws Exception {
|
||||
void testProfile(CapturedOutput output) throws Exception {
|
||||
SampleLogbackApplication.main(new String[] { "--spring.profiles.active=staging" });
|
||||
assertThat(capturedOutput).contains("Sample Debug Message").contains("Sample Trace Message");
|
||||
assertThat(output).contains("Sample Debug Message").contains("Sample Trace Message");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,20 +47,20 @@ class SampleProfileApplicationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDefaultProfile(CapturedOutput capturedOutput) {
|
||||
void testDefaultProfile(CapturedOutput output) {
|
||||
SampleProfileApplication.main(new String[0]);
|
||||
assertThat(capturedOutput).contains("Hello Phil");
|
||||
assertThat(output).contains("Hello Phil");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGoodbyeProfile(CapturedOutput capturedOutput) {
|
||||
void testGoodbyeProfile(CapturedOutput output) {
|
||||
System.setProperty("spring.profiles.active", "goodbye");
|
||||
SampleProfileApplication.main(new String[0]);
|
||||
assertThat(capturedOutput).contains("Goodbye Everyone");
|
||||
assertThat(output).contains("Goodbye Everyone");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGenericProfile(CapturedOutput capturedOutput) {
|
||||
void testGenericProfile(CapturedOutput output) {
|
||||
/*
|
||||
* This is a profile that requires a new environment property, and one which is
|
||||
* only overridden in the current working directory. That file also only contains
|
||||
@@ -69,13 +69,13 @@ class SampleProfileApplicationTests {
|
||||
*/
|
||||
System.setProperty("spring.profiles.active", "generic");
|
||||
SampleProfileApplication.main(new String[0]);
|
||||
assertThat(capturedOutput).contains("Bonjour Phil");
|
||||
assertThat(output).contains("Bonjour Phil");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGoodbyeProfileFromCommandline(CapturedOutput capturedOutput) {
|
||||
void testGoodbyeProfileFromCommandline(CapturedOutput output) {
|
||||
SampleProfileApplication.main(new String[] { "--spring.profiles.active=goodbye" });
|
||||
assertThat(capturedOutput).contains("Goodbye Everyone");
|
||||
assertThat(output).contains("Goodbye Everyone");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,13 +35,13 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleQuartzApplicationTests {
|
||||
|
||||
@Test
|
||||
void quartzJobIsTriggered(CapturedOutput capturedOutput) throws InterruptedException {
|
||||
void quartzJobIsTriggered(CapturedOutput output) throws InterruptedException {
|
||||
try (ConfigurableApplicationContext context = SpringApplication.run(SampleQuartzApplication.class)) {
|
||||
long end = System.currentTimeMillis() + 5000;
|
||||
while ((!capturedOutput.toString().contains("Hello World!")) && System.currentTimeMillis() < end) {
|
||||
while ((!output.toString().contains("Hello World!")) && System.currentTimeMillis() < end) {
|
||||
Thread.sleep(100);
|
||||
}
|
||||
assertThat(capturedOutput).contains("Hello World!");
|
||||
assertThat(output).contains("Hello World!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,15 +53,15 @@ class SampleSimpleApplicationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) {
|
||||
void testDefaultSettings(CapturedOutput output) {
|
||||
SampleSimpleApplication.main(new String[0]);
|
||||
assertThat(capturedOutput).contains("Hello Phil");
|
||||
assertThat(output).contains("Hello Phil");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCommandLineOverrides(CapturedOutput capturedOutput) {
|
||||
void testCommandLineOverrides(CapturedOutput output) {
|
||||
SampleSimpleApplication.main(new String[] { "--name=Gordon", "--duration=1m" });
|
||||
assertThat(capturedOutput).contains("Hello Gordon for 60 seconds");
|
||||
assertThat(output).contains("Hello Gordon for 60 seconds");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class SampleWsApplicationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSendingHolidayRequest(CapturedOutput capturedOutput) {
|
||||
void testSendingHolidayRequest(CapturedOutput output) {
|
||||
final String request = "<hr:HolidayRequest xmlns:hr=\"https://company.example.com/hr/schemas\">"
|
||||
+ " <hr:Holiday>" + " <hr:StartDate>2013-10-20</hr:StartDate>"
|
||||
+ " <hr:EndDate>2013-11-22</hr:EndDate>" + " </hr:Holiday>" + " <hr:Employee>"
|
||||
@@ -58,7 +58,7 @@ class SampleWsApplicationTests {
|
||||
StreamSource source = new StreamSource(new StringReader(request));
|
||||
StreamResult result = new StreamResult(System.out);
|
||||
this.webServiceTemplate.sendSourceAndReceiveToResult(source, result);
|
||||
assertThat(capturedOutput).contains("Booking holiday for");
|
||||
assertThat(output).contains("Booking holiday for");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class SampleSpringXmlApplicationTests {
|
||||
|
||||
@Test
|
||||
void testDefaultSettings(CapturedOutput capturedOutput) throws Exception {
|
||||
void testDefaultSettings(CapturedOutput output) throws Exception {
|
||||
SampleSpringXmlApplication.main(new String[0]);
|
||||
assertThat(capturedOutput).contains("Hello World");
|
||||
assertThat(output).contains("Hello World");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user