Polish output capture names

This commit is contained in:
Phillip Webb
2019-07-14 18:07:47 +01:00
parent cdf43a7489
commit c3816bfe7b
73 changed files with 328 additions and 335 deletions

View File

@@ -53,7 +53,7 @@ class SpringBootDependencyInjectionTestExecutionListenerTests {
}
@Test
void prepareFailingTestInstanceShouldPrintReport(CapturedOutput capturedOutput) throws Exception {
void prepareFailingTestInstanceShouldPrintReport(CapturedOutput output) throws Exception {
TestContext testContext = mock(TestContext.class);
given(testContext.getTestInstance()).willThrow(new IllegalStateException());
SpringApplication application = new SpringApplication(Config.class);
@@ -66,7 +66,7 @@ class SpringBootDependencyInjectionTestExecutionListenerTests {
catch (IllegalStateException ex) {
// Expected
}
assertThat(capturedOutput).contains("CONDITIONS EVALUATION REPORT").contains("Positive matches")
assertThat(output).contains("CONDITIONS EVALUATION REPORT").contains("Positive matches")
.contains("Negative matches");
}

View File

@@ -57,9 +57,9 @@ class MockMvcSpringBootTestIntegrationTests {
private MockMvc mvc;
@Test
void shouldFindController1(CapturedOutput capturedOutput) throws Exception {
void shouldFindController1(CapturedOutput output) throws Exception {
this.mvc.perform(get("/one")).andExpect(content().string("one")).andExpect(status().isOk());
assertThat(capturedOutput).contains("Request URI = /one");
assertThat(output).contains("Request URI = /one");
}
@Test

View File

@@ -47,9 +47,9 @@ class WebMvcTestPrintAlwaysIntegrationTests {
private MockMvc mvc;
@Test
void shouldPrint(CapturedOutput capturedOutput) throws Exception {
void shouldPrint(CapturedOutput output) throws Exception {
this.mvc.perform(get("/one")).andExpect(content().string("one")).andExpect(status().isOk());
assertThat(capturedOutput).contains("Request URI = /one");
assertThat(output).contains("Request URI = /one");
}
}

View File

@@ -47,15 +47,15 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
class WebMvcTestPrintDefaultIntegrationTests {
@Test
void shouldNotPrint(CapturedOutput capturedOutput) {
void shouldNotPrint(CapturedOutput output) {
executeTests(ShouldNotPrint.class);
assertThat(capturedOutput).doesNotContain("HTTP Method");
assertThat(output).doesNotContain("HTTP Method");
}
@Test
void shouldPrint(CapturedOutput capturedOutput) {
void shouldPrint(CapturedOutput output) {
executeTests(ShouldPrint.class);
assertThat(capturedOutput).contains("HTTP Method");
assertThat(output).contains("HTTP Method");
}
private void executeTests(Class<?> testClass) {

View File

@@ -47,9 +47,9 @@ class WebMvcTestPrintDefaultOverrideIntegrationTests {
private MockMvc mvc;
@Test
void shouldFindController1(CapturedOutput capturedOutput) throws Exception {
void shouldFindController1(CapturedOutput output) throws Exception {
this.mvc.perform(get("/one")).andExpect(content().string("one")).andExpect(status().isOk());
assertThat(capturedOutput).doesNotContain("Request URI = /one");
assertThat(output).doesNotContain("Request URI = /one");
}
}

View File

@@ -48,9 +48,9 @@ class WebMvcTestPrintOverrideIntegrationTests {
private MockMvc mvc;
@Test
void shouldNotPrint(CapturedOutput capturedOutput) throws Exception {
void shouldNotPrint(CapturedOutput output) throws Exception {
this.mvc.perform(get("/one")).andExpect(content().string("one")).andExpect(status().isOk());
assertThat(capturedOutput).doesNotContain("Request URI = /one");
assertThat(output).doesNotContain("Request URI = /one");
}
}