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
This commit is contained in:
Rob Winch 2015-07-27 10:18:31 -05:00
parent 14f27bda37
commit e998c450e6
3 changed files with 16 additions and 0 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();