Java 类org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder 实例源码

项目:Spring-Security-Third-Edition    文件:CalendarApplicationTests.java   
@Before
    public void setup() {
        webClient = MockMvcWebClientBuilder
                // demonstrates applying a MockMvcConfigurer (Spring Security)
//                .webAppContextSetup(context, springSecurity())
                .webAppContextSetup(context)
                // for illustration only - defaults to ""
                .contextPath("")
                // By default MockMvc is used for localhost only;
                // the following will use MockMvc for example.com and example.org as well
                .useMockMvcForHosts("example.com","example.org")
                .build();

        driver = MockMvcHtmlUnitDriverBuilder
                .webAppContextSetup(context)
                .build();

        /*MockMvc mockMvc = MockMvcBuilders
                .webAppContextSetup(context)
//                .apply(springSecurity())
                .build();

        webClient = MockMvcWebClientBuilder
                .mockMvcSetup(mockMvc)
                // for illustration only - defaults to ""
                .contextPath("")
                // By default MockMvc is used for localhost only;
                // the following will use MockMvc for example.com and example.org as well
                .useMockMvcForHosts("example.com","example.org")
                .build();*/
    }
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MockMvcWebDriverAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean({ WebDriver.class, MockMvcHtmlUnitDriverBuilder.class })
@ConditionalOnBean(MockMvc.class)
public MockMvcHtmlUnitDriverBuilder mockMvcHtmlUnitDriverBuilder(MockMvc mockMvc) {
    return MockMvcHtmlUnitDriverBuilder.mockMvcSetup(mockMvc)
            .withDelegate(new LocalHostWebConnectionHtmlUnitDriver(this.environment,
                    BrowserVersion.CHROME));
}
项目:pivotal-cla    文件:AdminLinkClaTests.java   
@WithSigningUser
@Test
public void methodSecurity() {
    WebDriver driver = MockMvcHtmlUnitDriverBuilder.webAppContextSetup(wac).build();

    assertThatThrownBy(() -> { AdminLinkClaPage.to(driver); }).hasRootCauseExactlyInstanceOf(AccessDeniedException.class);
}
项目:spring-boot-concourse    文件:MockMvcWebDriverAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean({ WebDriver.class, MockMvcHtmlUnitDriverBuilder.class })
@ConditionalOnBean(MockMvc.class)
public MockMvcHtmlUnitDriverBuilder mockMvcHtmlUnitDriverBuilder(MockMvc mockMvc) {
    return MockMvcHtmlUnitDriverBuilder.mockMvcSetup(mockMvc)
            .withDelegate(new LocalHostWebConnectionHtmlUnitDriver(this.environment,
                    BrowserVersion.CHROME));
}
项目:components-html5    文件:WebDriverTestsConfig.java   
@Before
@Override
   public void setup() {
    super.setup();
    webDriver = MockMvcHtmlUnitDriverBuilder
            .mockMvcSetup(mockMvc)
            .contextPath(contextPath)
            .build();

    LoginPage loginPage = new LoginPage(webDriver, contextPath, port);
    loginPage.login(ADMIN_USER_NAME, ADMIN_PASSWORD);
}
项目:spring4-sandbox    文件:MockMvcHtmlUnitWebDriverCreateTaskTests.java   
@Before
public void setUp() throws Exception {
    driver = MockMvcHtmlUnitDriverBuilder
            .webAppContextSetup(context)
            .withDelegate(new WebConnectionHtmlUnitDriver(BrowserVersion.CHROME))
            .contextPath("")
            .build();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MockMvcWebDriverAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(WebDriver.class)
@ConditionalOnBean(MockMvcHtmlUnitDriverBuilder.class)
public HtmlUnitDriver htmlUnitDriver(MockMvcHtmlUnitDriverBuilder builder) {
    return builder.build();
}
项目:spring-boot-concourse    文件:MockMvcWebDriverAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(WebDriver.class)
@ConditionalOnBean(MockMvcHtmlUnitDriverBuilder.class)
public HtmlUnitDriver htmlUnitDriver(MockMvcHtmlUnitDriverBuilder builder) {
    return builder.build();
}
项目:dddsample-core    文件:AbstractAcceptanceTest.java   
@Before
public void setup() {
    driver = MockMvcHtmlUnitDriverBuilder.webAppContextSetup(context).contextPath("/dddsample").build();
}
项目:spring-session    文件:FindByUsernameTests.java   
@Before
public void setup() {
    this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build();
}
项目:spring-session    文件:BootTests.java   
@Before
public void setup() {
    this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build();
}
项目:spring-session    文件:BootTests.java   
@Before
public void setup() {
    this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build();
}
项目:spring-session    文件:HttpRedisJsonTest.java   
@Before
public void setup() {
    this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build();
}
项目:demyo    文件:AbstractMvcTest.java   
/**
 * Sets up the HTMLUnit Web Client.
 * 
 * @throws Exception
 *             in case of error during setup.
 */
@Before
public void setupWebClient() throws Exception {
    webClient = MockMvcWebClientBuilder.webAppContextSetup(wac).build();
    webDriver = MockMvcHtmlUnitDriverBuilder.webAppContextSetup(wac).build();
}