use of org.springframework.boot.builder.SpringApplicationBuilder in project spring-boot by spring-projects.
the class BasicErrorControllerDirectMockMvcTests method errorPageAvailableWithParentContext.
@Test
public void errorPageAvailableWithParentContext() throws Exception {
setup((ConfigurableWebApplicationContext) new SpringApplicationBuilder(ParentConfiguration.class).child(ChildConfiguration.class).run("--server.port=0"));
MvcResult response = this.mockMvc.perform(get("/error").accept(MediaType.TEXT_HTML)).andExpect(status().is5xxServerError()).andReturn();
String content = response.getResponse().getContentAsString();
assertThat(content).contains("status=999");
}
Aggregations