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

项目: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    文件:MockMvcWebClientAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean({ WebClient.class, MockMvcWebClientBuilder.class })
@ConditionalOnBean(MockMvc.class)
public MockMvcWebClientBuilder mockMvcWebClientBuilder(MockMvc mockMvc) {
    return MockMvcWebClientBuilder.mockMvcSetup(mockMvc)
            .withDelegate(new LocalHostWebClient(this.environment));
}
项目:spring-boot-concourse    文件:MockMvcWebClientAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean({ WebClient.class, MockMvcWebClientBuilder.class })
@ConditionalOnBean(MockMvc.class)
public MockMvcWebClientBuilder mockMvcWebClientBuilder(MockMvc mockMvc) {
    return MockMvcWebClientBuilder.mockMvcSetup(mockMvc)
            .withDelegate(new LocalHostWebClient(this.environment));
}
项目:spring4-sandbox    文件:MockMvcWebClientCreateTaskTests.java   
@Before
public void setUp() throws Exception {
    webClient = MockMvcWebClientBuilder
            .webAppContextSetup(context)
            .withDelegate(new WebClient(BrowserVersion.CHROME))
            //.webAppContextSetup(context, springSecurity())
            // for illustration only - defaults to ""
            .contextPath("")
            //.useMockMvcForHosts("example.com","example.org")
            .build();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MockMvcWebClientAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
@ConditionalOnBean(MockMvcWebClientBuilder.class)
public WebClient htmlUnitWebClient(MockMvcWebClientBuilder builder) {
    return builder.build();
}
项目:spring-boot-concourse    文件:MockMvcWebClientAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
@ConditionalOnBean(MockMvcWebClientBuilder.class)
public WebClient htmlUnitWebClient(MockMvcWebClientBuilder builder) {
    return builder.build();
}
项目:workshop-spring-4.0-to-4.2    文件:HtmlUnitTest.java   
@Before
public void setup() {
    webClient = MockMvcWebClientBuilder
            .webAppContextSetup(context)
            .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();
}