|
|
|
|
@ -24,9 +24,11 @@ import org.junit.rules.ExpectedException;
@@ -24,9 +24,11 @@ import org.junit.rules.ExpectedException;
|
|
|
|
|
import org.junit.runner.RunWith; |
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.boot.autoconfigure.web.ErrorAttributes; |
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner; |
|
|
|
|
import org.springframework.test.web.servlet.MockMvc; |
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
import static org.hamcrest.CoreMatchers.isA; |
|
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; |
|
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; |
|
|
|
|
@ -48,6 +50,9 @@ public class WebMvcTestAllControllersIntegrationTests {
@@ -48,6 +50,9 @@ public class WebMvcTestAllControllersIntegrationTests {
|
|
|
|
|
@Autowired |
|
|
|
|
private MockMvc mvc; |
|
|
|
|
|
|
|
|
|
@Autowired(required = false) |
|
|
|
|
private ErrorAttributes errorAttributes; |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void shouldFindController1() throws Exception { |
|
|
|
|
this.mvc.perform(get("/one")).andExpect(content().string("one")) |
|
|
|
|
@ -78,4 +83,10 @@ public class WebMvcTestAllControllersIntegrationTests {
@@ -78,4 +83,10 @@ public class WebMvcTestAllControllersIntegrationTests {
|
|
|
|
|
this.mvc.perform(get("/three/invalid")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void shouldNotFilterErrorAttributes() throws Exception { |
|
|
|
|
assertThat(this.errorAttributes).isNotNull(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|