@ -17,10 +17,13 @@
package org.springframework.boot.test.autoconfigure.web.servlet ;
import com.gargoylesoftware.htmlunit.WebClient ;
import org.junit.Rule ;
import org.junit.Test ;
import org.junit.rules.ExpectedException ;
import org.junit.runner.RunWith ;
import org.openqa.selenium.WebDriver ;
import org.springframework.beans.factory.NoSuchBeanDefinitionException ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.context.ApplicationContext ;
import org.springframework.test.context.junit4.SpringRunner ;
@ -33,12 +36,16 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* Tests for { @link WebMvcTest } with { @link AutoConfigureMockMvc } .
*
* @author Phillip Webb
* @author Stephane Nicoll
* /
@RunWith ( SpringRunner . class )
@WebMvcTest
@AutoConfigureMockMvc ( addFilters = false , webClientEnabled = false , webDriverEnabled = false )
public class WebMvcTestWithAutoConfigureMockMvcIntegrationTests {
@Rule
public ExpectedException thrown = ExpectedException . none ( ) ;
@Autowired
private ApplicationContext context ;
@ -52,11 +59,13 @@ public class WebMvcTestWithAutoConfigureMockMvcIntegrationTests {
@Test
public void shouldNotHaveWebDriver ( ) throws Exception {
this . thrown . expect ( NoSuchBeanDefinitionException . class ) ;
this . context . getBean ( WebDriver . class ) ;
}
@Test
public void shouldNotHaveWebClient ( ) throws Exception {
this . thrown . expect ( NoSuchBeanDefinitionException . class ) ;
this . context . getBean ( WebClient . class ) ;
}