diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 21c96fb418..71f8ea45a5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -332,7 +332,7 @@ jobs: -Pvividus.batch-1.resource-include-patterns=ProxyStepsTests.story \ -Pvividus.selenium.grid.username=${SAUCELABS_USER} \ -Pvividus.selenium.grid.password=${SAUCELABS_KEY} \ - -Pvividus.saucelabs.sauce-connect.command-line-arguments="--proxy-localhost --no-ssl-bump-domains example.com" + -Pvividus.saucelabs.sauce-connect.command-line-arguments="--proxy-localhost allow --tls-passthrough-domains example\.com" else echo No SAUCELABS_USER and/or SAUCELABS_KEY, SauceLabs system tests will be skipped fi @@ -482,7 +482,7 @@ jobs: -Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \ -Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \ -Pvividus.allure.executor.report-name="SauceLabs iOS Proxy tests report" \ - -Pvividus.saucelabs.sauce-connect.command-line-arguments="--proxy-localhost --no-ssl-bump-domains example.com" \ + -Pvividus.saucelabs.sauce-connect.command-line-arguments="--proxy-localhost allow --tls-passthrough-domains example\.com" \ -Pvividus.variables.app-url=storage:filename=vividus-test-app-ios-$TEST_APP_VERSION.zip else echo No SAUCELABS_USER and/or SAUCELABS_KEY variables, System tests will be skipped @@ -557,7 +557,7 @@ jobs: -Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \ -Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \ -Pvividus.allure.executor.report-name="SauceLabs Android Proxy tests report" \ - -Pvividus.saucelabs.sauce-connect.command-line-arguments="--proxy-localhost --no-ssl-bump-domains example.com" \ + -Pvividus.saucelabs.sauce-connect.command-line-arguments="--proxy-localhost allow --tls-passthrough-domains example\.com" \ -Pvividus.variables.app-url=storage:filename=vividus-test-app-android-$TEST_APP_VERSION.zip else echo No SAUCELABS_USER and/or SAUCELABS_KEY variables, System tests will be skipped diff --git a/vividus-plugin-saucelabs/build.gradle b/vividus-plugin-saucelabs/build.gradle index b6ee41f6fa..33df895275 100644 --- a/vividus-plugin-saucelabs/build.gradle +++ b/vividus-plugin-saucelabs/build.gradle @@ -6,7 +6,7 @@ dependencies { implementation project(':vividus-extension-selenium') implementation(group: 'com.google.guava', name: 'guava', version: '33.4.0-jre') - implementation(group: 'com.saucelabs', name: 'ci-sauce', version: '1.183') + implementation(group: 'com.saucelabs', name: 'ci-sauce', version: '2.2') testImplementation platform(group: 'org.junit', name: 'junit-bom', version: '5.11.4') testImplementation(group: 'org.junit.jupiter', name: 'junit-jupiter') diff --git a/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceConnectOptions.java b/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceConnectOptions.java index 7fbc16a25a..ad33e2fcd6 100644 --- a/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceConnectOptions.java +++ b/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceConnectOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,12 +21,14 @@ import java.io.IOException; import java.nio.file.Path; import java.util.List; +import java.util.Locale; import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; -import java.util.stream.Stream; + +import com.saucelabs.saucerest.DataCenter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.SystemUtils; @@ -47,15 +49,15 @@ public class SauceConnectOptions extends TunnelOptions private static final String FULL_FILE_PROTOCOL = FILE_PROTOCOL + (SystemUtils.IS_OS_WINDOWS ? "/" : ""); private final boolean useLatestSauceConnect; - private final String restUrl; + private final DataCenter dataCenter; private final String customArguments; private final Set skipHostGlobPatterns; - public SauceConnectOptions(boolean useLatestSauceConnect, String restUrl, String customArguments, + public SauceConnectOptions(boolean useLatestSauceConnect, DataCenter dataCenter, String customArguments, Set skipHostGlobPatterns) { this.useLatestSauceConnect = useLatestSauceConnect; - this.restUrl = restUrl; + this.dataCenter = dataCenter; this.customArguments = customArguments; this.skipHostGlobPatterns = new TreeSet<>(skipHostGlobPatterns); this.skipHostGlobPatterns.addAll(List.of( @@ -70,11 +72,8 @@ public String build(String tunnelName) throws IOException { StringBuilder options = Optional.ofNullable(customArguments).map(args -> new StringBuilder(args).append(' ')) .orElseGet(StringBuilder::new); - if (tunnelName != null) - { - appendOption(options, "tunnel-name", tunnelName); - appendOption(options, "pidfile", createPidFile(tunnelName).toString()); - } + appendOption(options, "tunnel-name", tunnelName); + appendOption(options, "region", dataCenter.name().toLowerCase(Locale.ROOT).replace('_', '-')); if (getProxy() != null) { @@ -85,11 +84,7 @@ public String build(String tunnelName) throws IOException appendOption(options, "pac", pacFileUrl); } - if (restUrl != null) - { - appendOption(options, "rest-url", restUrl); - } - appendOption(options, "tunnel-pool"); + appendOption(options, "tunnel-pool", null); return options.substring(0, options.length() - 1); } @@ -106,15 +101,13 @@ private String getSkipShExpMatcher() .collect(Collectors.joining(" || ")); } - private Path createPidFile(String tunnelName) throws IOException - { - return createTempFile("sc_client-" + tunnelName + "-", ".pid", null); - } - - private static void appendOption(StringBuilder stringBuilder, String name, String... values) + private static void appendOption(StringBuilder stringBuilder, String name, String value) { stringBuilder.append("--").append(name).append(' '); - Stream.of(values).forEach(value -> stringBuilder.append(value).append(' ')); + if (value != null) + { + stringBuilder.append(value).append(' '); + } } @Override @@ -133,13 +126,13 @@ public boolean equals(Object o) return false; } SauceConnectOptions that = (SauceConnectOptions) o; - return useLatestSauceConnect == that.useLatestSauceConnect && Objects.equals(restUrl, that.restUrl) + return useLatestSauceConnect == that.useLatestSauceConnect && Objects.equals(dataCenter, that.dataCenter) && Objects.equals(skipHostGlobPatterns, that.skipHostGlobPatterns); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), useLatestSauceConnect, restUrl, skipHostGlobPatterns); + return Objects.hash(super.hashCode(), useLatestSauceConnect, dataCenter, skipHostGlobPatterns); } } diff --git a/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurer.java b/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurer.java index 510c5886c5..595fa4a112 100644 --- a/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurer.java +++ b/vividus-plugin-saucelabs/src/main/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ public class SauceLabsCapabilitiesConfigurer extends AbstractTunnellingCapabilit private static final String SAUCE_OPTIONS = "sauce:options"; private final boolean useLatestSauceConnect; - private final String restUrl; + private final DataCenter dataCenter; private String sauceConnectArguments; private Set skipHostGlobPatterns; @@ -38,7 +38,7 @@ public SauceLabsCapabilitiesConfigurer(boolean useLatestSauceConnect, RunContext { super(runContext, sauceConnectManager); this.useLatestSauceConnect = useLatestSauceConnect; - this.restUrl = dataCenter.apiServer() + "rest/v1"; + this.dataCenter = dataCenter; } @Override @@ -53,7 +53,7 @@ public void configure(DesiredCapabilities desiredCapabilities) @Override protected SauceConnectOptions createOptions() { - return new SauceConnectOptions(useLatestSauceConnect, restUrl, sauceConnectArguments, + return new SauceConnectOptions(useLatestSauceConnect, dataCenter, sauceConnectArguments, skipHostGlobPatterns == null ? Set.of() : skipHostGlobPatterns); } diff --git a/vividus-plugin-saucelabs/src/main/resources/vividus-plugin/spring.xml b/vividus-plugin-saucelabs/src/main/resources/vividus-plugin/spring.xml index 32348c0612..df011e2706 100644 --- a/vividus-plugin-saucelabs/src/main/resources/vividus-plugin/spring.xml +++ b/vividus-plugin-saucelabs/src/main/resources/vividus-plugin/spring.xml @@ -15,9 +15,8 @@ - - - + + diff --git a/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceConnectOptionsTests.java b/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceConnectOptionsTests.java index 141d9d0156..e8542d4fe0 100644 --- a/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceConnectOptionsTests.java +++ b/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceConnectOptionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,8 @@ import java.nio.file.Path; import java.util.Set; +import com.saucelabs.saucerest.DataCenter; + import org.apache.commons.lang3.SystemUtils; import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; @@ -37,16 +39,14 @@ class SauceConnectOptionsTests { private static final String SPACE = " "; private static final String PAC_FILE = "--pac file://"; - private static final String DOT_JS = ".js"; - private static final String PAC_TEST_TUNNEL = "pac-saucelabs-test-tunnel"; private static final String PROXY = "test"; private static final String TUNNEL_NAME = "test-tunnel"; - private static final String PID_FILE_NAME = "sc_client-" + TUNNEL_NAME + "-"; private static final String TUNNEL_NAME_OPTION = "--tunnel-name" + SPACE + TUNNEL_NAME; - private static final String PID_EXTENSION = ".pid"; private static final String TUNNEL_POOL = "--tunnel-pool"; - private static final String DEFAULT_REST_URL = "https://saucelabs.com/rest/v1/"; - private static final String DEFAULT_CUSTOM_ARGS = "--verbose"; + private static final DataCenter DATA_CENTER = DataCenter.US_WEST; + private static final String REGION = "us-west"; + private static final String REGION_OPTION = "--region" + SPACE + REGION; + private static final String DEFAULT_CUSTOM_ARGS = "--log-level debug"; private static final Set DEFAULT_SKIP_GLOB_HOST_PATTERNS = Set.of("vividus.dev"); private static final String DEFAULT_MATCH_CHAIN = "shExpMatch(host, \"*.api.testobject.com\") || " + "shExpMatch(host, \"*.miso.saucelabs.com\") || shExpMatch(host, \"*.saucelabs.com\") || " @@ -61,8 +61,6 @@ class SauceConnectOptionsTests + " return \"PROXY test\";%n" + "}%n"; - private static final String PID_FILE = "--pidfile"; - @Test void testBuildWithProxy() throws IOException { @@ -71,26 +69,24 @@ void testBuildWithProxy() throws IOException try (MockedStatic resources = mockStatic(ResourceUtils.class)) { Path pacPath = mockPac(resources, DEFAULT_MATCH_CHAIN); - Path pidPath = mockPid(resources); - assertEquals(TUNNEL_NAME_OPTION + SPACE + PID_FILE + SPACE + pidPath + SPACE + PAC_FILE + pacPath + SPACE - + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); + assertEquals(TUNNEL_NAME_OPTION + SPACE + REGION_OPTION + SPACE + PAC_FILE + pacPath + SPACE + TUNNEL_POOL, + sauceConnectOptions.build(TUNNEL_NAME)); } } @Test void testBuildWithProxyForLatestSauceConnect() throws IOException { - SauceConnectOptions sauceConnectOptions = new SauceConnectOptions(true, null, null, Set.of()); + SauceConnectOptions sauceConnectOptions = new SauceConnectOptions(true, DATA_CENTER, null, Set.of()); sauceConnectOptions.setProxy(PROXY); try (MockedStatic resources = mockStatic(ResourceUtils.class)) { Path pacPath = mockPac(resources, DEFAULT_MATCH_CHAIN); - Path pidPath = mockPid(resources); - assertEquals(TUNNEL_NAME_OPTION + SPACE + PID_FILE + SPACE + pidPath + SPACE + PAC_FILE + ( - SystemUtils.IS_OS_WINDOWS ? "/" : "") + pacPath + SPACE + TUNNEL_POOL, - sauceConnectOptions.build(TUNNEL_NAME)); + assertEquals( + TUNNEL_NAME_OPTION + SPACE + REGION_OPTION + SPACE + PAC_FILE + (SystemUtils.IS_OS_WINDOWS ? "/" + : "") + pacPath + SPACE + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); } } @@ -103,10 +99,9 @@ void testBuildWithProxyWindowsPathDelimiters() throws IOException { Path pacPath = mockPac(resources, DEFAULT_MATCH_CHAIN); when(pacPath.toString()).thenReturn("c:\\user\\temp.js"); - Path pidPath = mockPid(resources); - assertEquals(TUNNEL_NAME_OPTION + SPACE + PID_FILE + SPACE + pidPath + SPACE + PAC_FILE + "c:/user/temp.js" - + SPACE + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); + assertEquals(TUNNEL_NAME_OPTION + SPACE + REGION_OPTION + SPACE + PAC_FILE + "c:/user/temp.js" + SPACE + + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); } } @@ -114,15 +109,13 @@ void testBuildWithProxyWindowsPathDelimiters() throws IOException void testBuildWithProxyWithAuth() throws IOException { String customFlags = "--auth host:9999:user:pass"; - SauceConnectOptions sauceConnectOptions = createOptions(null, customFlags, Set.of(), PROXY); + SauceConnectOptions sauceConnectOptions = createOptions(customFlags, Set.of(), PROXY); try (MockedStatic resources = mockStatic(ResourceUtils.class)) { Path pacPath = mockPac(resources, DEFAULT_MATCH_CHAIN); - Path pidPath = mockPid(resources); - assertEquals( - customFlags + SPACE + TUNNEL_NAME_OPTION + SPACE + PID_FILE + SPACE + pidPath + SPACE + PAC_FILE - + pacPath + SPACE + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); + assertEquals(customFlags + SPACE + TUNNEL_NAME_OPTION + SPACE + REGION_OPTION + SPACE + PAC_FILE + pacPath + + SPACE + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); } } @@ -130,45 +123,25 @@ void testBuildWithProxyWithAuth() throws IOException void testBuildWithProxyWithSkipHostsPattern() throws IOException { Set hosts = Set.of("example.com", "*.vividus.dev"); - SauceConnectOptions sauceConnectOptions = createOptions(null, null, hosts, PROXY); + SauceConnectOptions sauceConnectOptions = createOptions(null, hosts, PROXY); try (MockedStatic resources = mockStatic(ResourceUtils.class)) { String matchCondition = "shExpMatch(host, \"*.api.testobject.com\") || shExpMatch" + "(host, \"*.miso.saucelabs.com\") || shExpMatch(host, \"*.saucelabs.com\") || shExpMatch(host, " + "\"*.vividus.dev\") || shExpMatch(host, \"example.com\") || shExpMatch(host, \"saucelabs.com\")"; Path pacPath = mockPac(resources, matchCondition); - Path pidPath = mockPid(resources); - - assertEquals(TUNNEL_NAME_OPTION + SPACE + PID_FILE + SPACE + pidPath + SPACE + PAC_FILE + pacPath + SPACE - + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); - } - } - - @Test - void testBuildWOProxy() throws IOException - { - try (MockedStatic resources = mockStatic(ResourceUtils.class)) - { - Path pidPath = mockPid(resources); - SauceConnectOptions sauceConnectOptions = createEmptyOptions(); - assertEquals(TUNNEL_NAME_OPTION + SPACE + PID_FILE + SPACE + pidPath + SPACE + TUNNEL_POOL, + assertEquals(TUNNEL_NAME_OPTION + SPACE + REGION_OPTION + SPACE + PAC_FILE + pacPath + SPACE + TUNNEL_POOL, sauceConnectOptions.build(TUNNEL_NAME)); } } @Test - void testBuildWOProxyNullOption() throws IOException + void testBuildWOProxy() throws IOException { SauceConnectOptions sauceConnectOptions = createEmptyOptions(); - assertEquals(TUNNEL_POOL, sauceConnectOptions.build(null)); - } - - @Test - void testBuildWithRestUrl() throws IOException - { - SauceConnectOptions sauceConnectOptions = createOptions(DEFAULT_REST_URL, null, Set.of(), null); - assertEquals("--rest-url" + SPACE + DEFAULT_REST_URL + SPACE + TUNNEL_POOL, sauceConnectOptions.build(null)); + assertEquals(TUNNEL_NAME_OPTION + SPACE + REGION_OPTION + SPACE + TUNNEL_POOL, + sauceConnectOptions.build(TUNNEL_NAME)); } @Test @@ -210,46 +183,45 @@ void testNotEqualsProxy() @Test void testNotEqualsSkipProxyHostsPattern() { - assertNotEquals(createOptions(DEFAULT_REST_URL, DEFAULT_CUSTOM_ARGS, Set.of(), PROXY), createDefaultOptions()); + assertNotEquals(createOptions(DEFAULT_CUSTOM_ARGS, Set.of(), PROXY), createDefaultOptions()); } @Test - void testNotEqualsRestUrl() + void testNotEqualsDataCenter() { - assertNotEquals(createOptions(null, DEFAULT_CUSTOM_ARGS, DEFAULT_SKIP_GLOB_HOST_PATTERNS, PROXY), + assertNotEquals( + createOptions(DataCenter.EU_CENTRAL, DEFAULT_CUSTOM_ARGS, DEFAULT_SKIP_GLOB_HOST_PATTERNS, PROXY), createDefaultOptions()); } private SauceConnectOptions createDefaultOptions() { - return createOptions(DEFAULT_REST_URL, DEFAULT_CUSTOM_ARGS, DEFAULT_SKIP_GLOB_HOST_PATTERNS, PROXY); + return createOptions(DEFAULT_CUSTOM_ARGS, DEFAULT_SKIP_GLOB_HOST_PATTERNS, PROXY); } private SauceConnectOptions createEmptyOptions() { - return createOptions(null, null, Set.of(), null); + return createOptions(null, Set.of(), null); } - private SauceConnectOptions createOptions(String restUrl, String customArguments, Set skipHostGlobPatterns, - String proxy) + private SauceConnectOptions createOptions(String customArguments, Set skipHostGlobPatterns, String proxy) { - SauceConnectOptions options = new SauceConnectOptions(false, restUrl, customArguments, skipHostGlobPatterns); - options.setProxy(proxy); - return options; + return createOptions(DATA_CENTER, customArguments, skipHostGlobPatterns, proxy); } - private Path mockPid(MockedStatic mock) + private static SauceConnectOptions createOptions(DataCenter dataCenter, String customArguments, + Set skipHostGlobPatterns, String proxy) { - Path pidPath = mock(Path.class); - mock.when(() -> ResourceUtils.createTempFile(PID_FILE_NAME, PID_EXTENSION, null)).thenReturn(pidPath); - return pidPath; + SauceConnectOptions options = new SauceConnectOptions(false, dataCenter, customArguments, skipHostGlobPatterns); + options.setProxy(proxy); + return options; } private Path mockPac(MockedStatic mock, String matchCondition) { Path pacPath = mock(Path.class); - mock.when(() -> ResourceUtils.createTempFile(PAC_TEST_TUNNEL, DOT_JS, String.format(PAC_DATA, matchCondition))) - .thenReturn(pacPath); + mock.when(() -> ResourceUtils.createTempFile("pac-saucelabs-test-tunnel", ".js", + String.format(PAC_DATA, matchCondition))).thenReturn(pacPath); return pacPath; } } diff --git a/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurerTests.java b/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurerTests.java index 76f1cb3869..4efe8eb2ab 100644 --- a/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurerTests.java +++ b/vividus-plugin-saucelabs/src/test/java/org/vividus/selenium/sauce/SauceLabsCapabilitiesConfigurerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,9 +60,9 @@ class SauceLabsCapabilitiesConfigurerTests private static final String STORY_PATH = STORY_NAME + ".story"; - private static final String REST_URL = "https://api.eu-central-1.saucelabs.com/rest/v1"; private static final String CUSTOM_ARGS = "--verbose"; private static final Set SKIP_HOST_GLOB_PATTERNS = Set.of("example.com"); + private static final DataCenter DATA_CENTER = DataCenter.EU_CENTRAL; @Mock private RunContext runContext; @Mock private SauceConnectManager sauceConnectManager; @@ -71,7 +71,7 @@ class SauceLabsCapabilitiesConfigurerTests @BeforeEach void beforeEach() { - configurer = new SauceLabsCapabilitiesConfigurer(true, runContext, sauceConnectManager, DataCenter.EU_CENTRAL); + configurer = new SauceLabsCapabilitiesConfigurer(true, runContext, sauceConnectManager, DATA_CENTER); } @Test @@ -99,7 +99,7 @@ void shouldStartSauceConnectWhenSauceConnectIsEnabled() configurer.setTunnellingEnabled(true); Map sauceOptions = new HashMap<>(); var desiredCapabilities = mockDesiredCapabilities(null, sauceOptions); - var sauceConnectOptions = new SauceConnectOptions(true, REST_URL, null, Set.of()); + var sauceConnectOptions = new SauceConnectOptions(true, DATA_CENTER, null, Set.of()); when(sauceConnectManager.start(sauceConnectOptions)).thenReturn(TUNNEL_NAME); configurer.configure(desiredCapabilities); @@ -118,7 +118,7 @@ void shouldStartSauceConnectWhenSauceConnectIsDisabledButProxyIsStarted() var httpProxy = "http-proxy:8080"; when(proxy.getHttpProxy()).thenReturn(httpProxy); - var sauceConnectOptions = new SauceConnectOptions(true, REST_URL, CUSTOM_ARGS, SKIP_HOST_GLOB_PATTERNS); + var sauceConnectOptions = new SauceConnectOptions(true, DATA_CENTER, CUSTOM_ARGS, SKIP_HOST_GLOB_PATTERNS); sauceConnectOptions.setProxy(httpProxy); Map sauceOptions = new HashMap<>(); @@ -146,7 +146,8 @@ void shouldCreateOptions(Set setValue, Set expectedValue) { configurer.setSauceConnectArguments(CUSTOM_ARGS); configurer.setSkipHostGlobPatterns(setValue); - assertEquals(new SauceConnectOptions(true, REST_URL, CUSTOM_ARGS, expectedValue), configurer.createOptions()); + assertEquals(new SauceConnectOptions(true, DATA_CENTER, CUSTOM_ARGS, expectedValue), + configurer.createOptions()); } private void mockRunningStory()