use of org.springframework.boot.test.context.runner.WebApplicationContextRunner in project spring-boot by spring-projects.
the class ConditionalOnWarDeploymentTests method warDeployedServletWebApplicationShouldMatch.
@Test
void warDeployedServletWebApplicationShouldMatch() {
// sets a mock servletContext before context refresh which is what the
// SpringBootServletInitializer does for WAR deployments.
WebApplicationContextRunner contextRunner = new WebApplicationContextRunner();
contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> assertThat(context).hasBean("forWar"));
}
Aggregations