Polish output capture names
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user