提交 e998c450 编写于 作者: R Rob Winch

Add Assume PERFORMANCE to needed HtmlUnit Tests

Some of the HtmlUnit Tests required an internet connection. This
caused failures when running offline.

This commit adds Assume PERFORMANCE to those tests so they are
only ran when the PERFORMANCE group is selected.

Issue: SPR-13158
上级 14f27bda
......@@ -30,6 +30,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.htmlunit.DelegatingWebConnection.DelegateWebConnection;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import com.gargoylesoftware.htmlunit.HttpWebConnection;
import com.gargoylesoftware.htmlunit.Page;
......@@ -122,6 +124,8 @@ public class DelegatingWebConnectionTests {
@Test
public void verifyExampleInClassLevelJavadoc() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
WebClient webClient = new WebClient();
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(TestController.class).build();
......
......@@ -31,6 +31,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.WebApplicationContext;
......@@ -80,6 +82,8 @@ public class MockMvcWebClientBuilderTests {
@Test
public void mockMvcSetupAndConfigureWebClient() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
this.webClient = MockMvcWebClientBuilder
.mockMvcSetup(this.mockMvc)
.configureWebClient(this.webClient);
......@@ -90,6 +94,8 @@ public class MockMvcWebClientBuilderTests {
@Test
public void mockMvcSetupAndCreateWebClient() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
this.webClient = MockMvcWebClientBuilder
.mockMvcSetup(this.mockMvc)
.createWebClient();
......
......@@ -33,6 +33,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.WebApplicationContext;
......@@ -79,6 +81,8 @@ public class MockMvcHtmlUnitDriverBuilderTests {
@Test
public void mockMvcSetupAndConfigureDriver() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
this.driver = MockMvcHtmlUnitDriverBuilder
.mockMvcSetup(this.mockMvc)
.configureDriver(new WebConnectionHtmlUnitDriver());
......@@ -89,6 +93,8 @@ public class MockMvcHtmlUnitDriverBuilderTests {
@Test
public void mockMvcSetupAndCreateDriver() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
this.driver = MockMvcHtmlUnitDriverBuilder
.mockMvcSetup(this.mockMvc)
.createDriver();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册