diff --git a/pom.xml b/pom.xml index 2dbf88a1..93bb5e46 100644 --- a/pom.xml +++ b/pom.xml @@ -14,8 +14,8 @@ 2.452 ${jenkins.baseline}.4 - 1.179 - 2.4.0 + 2.0 + 2.5.3 @@ -104,7 +104,7 @@ org.jetbrains.kotlin kotlin-stdlib-jdk8 - 1.9.21 + 1.9.25 @@ -310,6 +310,12 @@ 2.0.21 + + com.squareup.okio + okio + 3.9.1 + + org.jenkins-ci.main jenkins-test-harness-tools @@ -322,6 +328,12 @@ mockito-core test + + com.squareup.moshi + moshi + 1.15.1 + test + diff --git a/src/main/java/com/saucelabs/jenkins/HudsonSauceConnectFourManager.java b/src/main/java/com/saucelabs/jenkins/HudsonSauceConnectManager.java similarity index 78% rename from src/main/java/com/saucelabs/jenkins/HudsonSauceConnectFourManager.java rename to src/main/java/com/saucelabs/jenkins/HudsonSauceConnectManager.java index 2e1fdcb0..ce7f4726 100644 --- a/src/main/java/com/saucelabs/jenkins/HudsonSauceConnectFourManager.java +++ b/src/main/java/com/saucelabs/jenkins/HudsonSauceConnectManager.java @@ -1,12 +1,12 @@ package com.saucelabs.jenkins; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import org.apache.commons.lang.StringUtils; /** * @author Ross Rowe */ -public class HudsonSauceConnectFourManager extends SauceConnectFourManager { +public class HudsonSauceConnectManager extends SauceConnectManager { private String workingDirectory; diff --git a/src/main/java/com/saucelabs/jenkins/HudsonSauceManagerFactory.java b/src/main/java/com/saucelabs/jenkins/HudsonSauceManagerFactory.java index 52f24ffe..0193d326 100644 --- a/src/main/java/com/saucelabs/jenkins/HudsonSauceManagerFactory.java +++ b/src/main/java/com/saucelabs/jenkins/HudsonSauceManagerFactory.java @@ -1,6 +1,6 @@ package com.saucelabs.jenkins; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; @@ -13,7 +13,7 @@ public class HudsonSauceManagerFactory { private Lock accessLock = new ReentrantLock(); - private SauceConnectFourManager sauceConnectFourManager; + private SauceConnectManager sauceConnectManager; public static HudsonSauceManagerFactory getInstance() { return INSTANCE; @@ -22,14 +22,14 @@ public static HudsonSauceManagerFactory getInstance() { private HudsonSauceManagerFactory() { } - public SauceConnectFourManager createSauceConnectFourManager() { + public SauceConnectManager createSauceConnectManager() { accessLock.lock(); try { - if (sauceConnectFourManager == null) + if (sauceConnectManager == null) { - sauceConnectFourManager = new HudsonSauceConnectFourManager(); + sauceConnectManager = new HudsonSauceConnectManager(); } - return sauceConnectFourManager; + return sauceConnectManager; } finally { accessLock.unlock(); } diff --git a/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java b/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java index 3d1eb40c..90d2ca2e 100644 --- a/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java +++ b/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java @@ -4,7 +4,7 @@ import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel; import com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import com.saucelabs.jenkins.HudsonSauceManagerFactory; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; @@ -107,11 +107,6 @@ public Boolean getUseLatestSauceConnect() { return useLatestSauceConnect; } - @DataBoundSetter - public void setUseLatestSauceConnect(Boolean useLatestSauceConnect) { - this.useLatestSauceConnect = useLatestSauceConnect; - } - public Boolean getVerboseLogging() { return verboseLogging; } @@ -174,7 +169,7 @@ private static final class SauceStartConnectHandler extends MasterToSlaveCallabl @Override public Void call() throws AbstractSauceTunnelManager.SauceConnectException { - SauceConnectFourManager sauceTunnelManager = getSauceTunnelManager(); + SauceConnectManager sauceTunnelManager = getSauceTunnelManager(); sauceTunnelManager.setSauceRest(sauceCredentials.getSauceREST(proxy)); sauceTunnelManager.setUseLatestSauceConnect(useLatestSauceConnect); sauceTunnelManager.openConnection( @@ -208,7 +203,7 @@ private static final class SauceStopConnectHandler extends MasterToSlaveCallable @Override public Void call() throws AbstractSauceTunnelManager.SauceConnectException { - SauceConnectFourManager sauceTunnelManager = getSauceTunnelManager(); + SauceConnectManager sauceTunnelManager = getSauceTunnelManager(); sauceTunnelManager.setSauceRest(sauceCredentials.getSauceREST(proxy)); sauceTunnelManager.closeTunnelsForPlan( sauceCredentials.getUsername(), @@ -324,8 +319,8 @@ public void stop(@NonNull Throwable cause) throws Exception { } - public static SauceConnectFourManager getSauceTunnelManager() { - return HudsonSauceManagerFactory.getInstance().createSauceConnectFourManager(); + public static SauceConnectManager getSauceTunnelManager() { + return HudsonSauceManagerFactory.getInstance().createSauceConnectManager(); } private static final class Callback extends BodyExecutionCallback.TailCall { diff --git a/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java b/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java index 5706e405..7a5d6a92 100755 --- a/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java +++ b/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java @@ -27,7 +27,7 @@ import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel; import com.saucelabs.ci.Browser; import com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager; -import com.saucelabs.jenkins.HudsonSauceConnectFourManager; +import com.saucelabs.jenkins.HudsonSauceConnectManager; import com.saucelabs.jenkins.HudsonSauceManagerFactory; import com.saucelabs.saucerest.DataCenter; import com.saucelabs.saucerest.SauceException; @@ -191,6 +191,14 @@ public class SauceOnDemandBuildWrapper extends BuildWrapper implements Serializa /** Indicates whether Sauce Connect should be started as part of the build. */ private boolean enableSauceConnect; + private static Map endpointToRegion = Map.of( + "https://saucelabs.com/", "us-west", + "https://eu-central-1.saucelabs.com/", "eu-central", + "https://us-east-4.saucelabs.com/", "us-east", + // Deprecated endpoint but it hasn't been removed from Sauce Credentials yet + "https://us-east-1.saucelabs.com/", "us-east" + ); + /** Host location of the selenium server. */ private String seleniumHost; @@ -340,7 +348,7 @@ private static String getCurrentHostName() { * @throws ComponentLookupException see plexus */ public static AbstractSauceTunnelManager getSauceTunnelManager() throws ComponentLookupException { - return HudsonSauceManagerFactory.getInstance().createSauceConnectFourManager(); + return HudsonSauceManagerFactory.getInstance().createSauceConnectManager(); } @Override @@ -392,7 +400,7 @@ public Environment setUp( } build.getBuildVariables().put(SAUCE_REST_ENDPOINT, restEndpoint); - resolvedOptions = resolvedOptions + " -x " + restEndpoint + "rest/v1"; + resolvedOptions = resolvedOptions + " --region " + this.endpointToRegion.get(restEndpoint); try { if (condition != null) { @@ -925,10 +933,6 @@ public boolean isUseLatestSauceConnect() { return useLatestSauceConnect; } - public void setUseLatestSauceConnect(boolean useLatestSauceConnect) { - this.useLatestSauceConnect = useLatestSauceConnect; - } - public boolean isUseGeneratedTunnelIdentifier() { return useGeneratedTunnelIdentifier; } @@ -1170,11 +1174,11 @@ public SauceConnectHandler call() throws AbstractSauceTunnelManager.SauceConnect try { listener.getLogger().println("Launching Sauce Connect on " + getCurrentHostName()); sauceTunnelManager = getSauceTunnelManager(); - if (sauceTunnelManager instanceof HudsonSauceConnectFourManager + if (sauceTunnelManager instanceof HudsonSauceConnectManager && workingDirectory != null) { - ((HudsonSauceConnectFourManager) sauceTunnelManager) + ((HudsonSauceConnectManager) sauceTunnelManager) .setWorkingDirectory(workingDirectory); - ((HudsonSauceConnectFourManager) sauceTunnelManager) + ((HudsonSauceConnectManager) sauceTunnelManager) .setUseLatestSauceConnect(useLatestSauceConnect); } sauceTunnelManager.setSauceRest(new JenkinsSauceREST(username, key, dataCenter, proxy)); @@ -1305,7 +1309,7 @@ public Map> getWebDriverMap() { * @return Sauce Connect version */ public String getSauceConnectVersion() { - return HudsonSauceConnectFourManager.CURRENT_SC_VERSION; + return HudsonSauceConnectManager.CURRENT_SC_VERSION; } /** diff --git a/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java b/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java index b44cacf6..c3f822d0 100644 --- a/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java +++ b/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java @@ -1,6 +1,6 @@ package hudson.plugins.sauce_ondemand; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import com.saucelabs.jenkins.HudsonSauceManagerFactory; import hudson.FilePath; import hudson.matrix.MatrixBuild; @@ -190,7 +190,7 @@ public void doGenerateSupportZip(StaplerRequest req, StaplerResponse rsp) throws Permission p = Project.CONFIGURE; ac.checkPermission(p); - SauceConnectFourManager manager = HudsonSauceManagerFactory.getInstance().createSauceConnectFourManager(); + SauceConnectManager manager = HudsonSauceManagerFactory.getInstance().createSauceConnectManager(); SauceOnDemandBuildWrapper sauceBuildWrapper = getBuildWrapper(); Run build = job.getLastBuild(); @@ -231,7 +231,7 @@ public void doGenerateSupportZip(StaplerRequest req, StaplerResponse rsp) throws } public static class BuildSupportZipUtils { - public static void buildSauceConnectLog(ZipOutputStream zipOutputStream, SauceConnectFourManager manager, AbstractBuild build, SauceOnDemandBuildWrapper sauceBuildWrapper) throws IOException, InterruptedException { + public static void buildSauceConnectLog(ZipOutputStream zipOutputStream, SauceConnectManager manager, AbstractBuild build, SauceOnDemandBuildWrapper sauceBuildWrapper) throws IOException, InterruptedException { if (sauceBuildWrapper.isEnableSauceConnect()) { File sauceConnectLogFile = manager.getSauceConnectLogFile(sauceBuildWrapper.getOptions()); if (sauceBuildWrapper.isLaunchSauceConnectOnSlave()) { diff --git a/src/test/java/com/saucelabs/jenkins/HudsonSauceConnectFourManagerTest.java b/src/test/java/com/saucelabs/jenkins/HudsonSauceConnectManagerTest.java similarity index 83% rename from src/test/java/com/saucelabs/jenkins/HudsonSauceConnectFourManagerTest.java rename to src/test/java/com/saucelabs/jenkins/HudsonSauceConnectManagerTest.java index ba7f1b9d..f78c73a5 100644 --- a/src/test/java/com/saucelabs/jenkins/HudsonSauceConnectFourManagerTest.java +++ b/src/test/java/com/saucelabs/jenkins/HudsonSauceConnectManagerTest.java @@ -5,13 +5,13 @@ import org.junit.Before; import org.junit.Test; -public class HudsonSauceConnectFourManagerTest { +public class HudsonSauceConnectManagerTest { - private HudsonSauceConnectFourManager manager; + private HudsonSauceConnectManager manager; @Before public void setUp() throws Exception { - this.manager = new HudsonSauceConnectFourManager(); + this.manager = new HudsonSauceConnectManager(); } @Test @@ -30,4 +30,4 @@ public void specificWorkingDirectory() throws Exception { this.manager.setWorkingDirectory("/path"); assertEquals("/path", this.manager.getSauceConnectWorkingDirectory()); } -} \ No newline at end of file +} diff --git a/src/test/java/com/saucelabs/jenkins/pipeline/SauceStepTest.java b/src/test/java/com/saucelabs/jenkins/pipeline/SauceStepTest.java index 324b2bde..f21f1ca6 100644 --- a/src/test/java/com/saucelabs/jenkins/pipeline/SauceStepTest.java +++ b/src/test/java/com/saucelabs/jenkins/pipeline/SauceStepTest.java @@ -4,7 +4,7 @@ import com.auth0.jwt.JWT; import com.auth0.jwt.algorithms.Algorithm; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import com.saucelabs.jenkins.HudsonSauceManagerFactory; import com.saucelabs.saucerest.DataCenter; @@ -35,11 +35,11 @@ public void setUp() throws Exception { } } - private void storeDummyManager(SauceConnectFourManager sauceConnectFourManager) throws Exception { + private void storeDummyManager(SauceConnectManager sauceConnectManager) throws Exception { HudsonSauceManagerFactory factory = HudsonSauceManagerFactory.getInstance(); - Field field = HudsonSauceManagerFactory.class.getDeclaredField("sauceConnectFourManager"); + Field field = HudsonSauceManagerFactory.class.getDeclaredField("sauceConnectManager"); field.setAccessible(true); - field.set(factory, sauceConnectFourManager); + field.set(factory, sauceConnectManager); } @Test @@ -96,13 +96,13 @@ public void sauceConnectWithGlobalOptionsTest() throws Exception { String credentialsId = SauceCredentials.migrateToCredentials("fakeuser", "fakekey", null, "unittest"); - SauceConnectFourManager sauceConnectFourManager = Mockito.mock(SauceConnectFourManager.class); + SauceConnectManager sauceConnectManager = Mockito.mock(SauceConnectManager.class); - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); // stubbing appears before the actual execution Mockito.when( - sauceConnectFourManager.openConnection( + sauceConnectManager.openConnection( Mockito.anyString(), Mockito.anyString(), Mockito.any(DataCenter.class), @@ -131,7 +131,7 @@ public void sauceConnectWithGlobalOptionsTest() throws Exception { r.assertLogContains("USERNAME=fakeuser", run); r.assertLogContains("ACCESS_KEY=fakekey", run); - Mockito.verify(sauceConnectFourManager) + Mockito.verify(sauceConnectManager) .openConnection( Mockito.eq("fakeuser"), Mockito.eq("fakekey"), diff --git a/src/test/java/hudson/plugins/sauce_ondemand/ExtractSauceConnectTest.java b/src/test/java/hudson/plugins/sauce_ondemand/ExtractSauceConnectTest.java index e6170c9b..dbcd26f4 100644 --- a/src/test/java/hudson/plugins/sauce_ondemand/ExtractSauceConnectTest.java +++ b/src/test/java/hudson/plugins/sauce_ondemand/ExtractSauceConnectTest.java @@ -1,6 +1,6 @@ package hudson.plugins.sauce_ondemand; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import java.io.File; import org.junit.Before; import org.junit.Test; @@ -10,7 +10,7 @@ */ public class ExtractSauceConnectTest { - private SauceConnectFourManager manager = new SauceConnectFourManager(); + private SauceConnectManager manager = new SauceConnectManager(); @Before public void setUp() throws Exception { @@ -20,11 +20,11 @@ public void setUp() throws Exception { @Test public void linux() throws Exception { File workingDirectory = new File(System.getProperty("java.io.tmpdir")); - manager.extractZipFile(workingDirectory, SauceConnectFourManager.OperatingSystem.LINUX); + manager.extractZipFile(workingDirectory, SauceConnectManager.OperatingSystem.LINUX_AMD64); } @Test public void windows() throws Exception { - manager.extractZipFile(new File(System.getProperty("java.io.tmpdir")), SauceConnectFourManager.OperatingSystem.WINDOWS); + manager.extractZipFile(new File(System.getProperty("java.io.tmpdir")), SauceConnectManager.OperatingSystem.WINDOWS_AMD64); } } diff --git a/src/test/java/hudson/plugins/sauce_ondemand/ParameterizedSauceBuildWrapperTest.java b/src/test/java/hudson/plugins/sauce_ondemand/ParameterizedSauceBuildWrapperTest.java index 77861262..dd0df497 100644 --- a/src/test/java/hudson/plugins/sauce_ondemand/ParameterizedSauceBuildWrapperTest.java +++ b/src/test/java/hudson/plugins/sauce_ondemand/ParameterizedSauceBuildWrapperTest.java @@ -8,7 +8,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import com.saucelabs.jenkins.HudsonSauceManagerFactory; import com.saucelabs.saucerest.DataCenter; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -113,8 +113,8 @@ public void setUp() throws Exception { String credentialsId = SauceCredentials.migrateToCredentials("fakeuser", "fakekey", null, "unittest"); - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -130,7 +130,7 @@ public Process openConnection( } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); JSONObject pluginConfig = new JSONObject(); pluginConfig.put("username", "fakeuser"); @@ -159,11 +159,11 @@ public void tearDown() throws Exception { storeDummyManager(null); } - private void storeDummyManager(SauceConnectFourManager sauceConnectFourManager) throws Exception { + private void storeDummyManager(SauceConnectManager sauceConnectManager) throws Exception { HudsonSauceManagerFactory factory = HudsonSauceManagerFactory.getInstance(); - Field field = HudsonSauceManagerFactory.class.getDeclaredField("sauceConnectFourManager"); + Field field = HudsonSauceManagerFactory.class.getDeclaredField("sauceConnectManager"); field.setAccessible(true); - field.set(factory, sauceConnectFourManager); + field.set(factory, sauceConnectManager); } /** @@ -177,8 +177,8 @@ public void portIsProperlyProvidedToSauceConnect() throws Exception { final JSONObject holder = new JSONObject(); - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -195,7 +195,7 @@ public Process openConnection( } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); SauceBuilder sauceBuilder = new SauceBuilder() { @Override diff --git a/src/test/java/hudson/plugins/sauce_ondemand/SauceBuildWrapperTest.java b/src/test/java/hudson/plugins/sauce_ondemand/SauceBuildWrapperTest.java index 83fd84ff..fcd8edce 100644 --- a/src/test/java/hudson/plugins/sauce_ondemand/SauceBuildWrapperTest.java +++ b/src/test/java/hudson/plugins/sauce_ondemand/SauceBuildWrapperTest.java @@ -12,7 +12,7 @@ import static org.mockito.Mockito.when; import com.cloudbees.plugins.credentials.SystemCredentialsProvider; -import com.saucelabs.ci.sauceconnect.SauceConnectFourManager; +import com.saucelabs.ci.sauceconnect.SauceConnectManager; import com.saucelabs.jenkins.HudsonSauceManagerFactory; import com.saucelabs.saucerest.DataCenter; import com.saucelabs.saucerest.JobSource; @@ -116,8 +116,8 @@ public void setUp() throws Exception { // store dummy implementations of Sauce Connect manager - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -132,7 +132,7 @@ public Process openConnection( return null; } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); EnvironmentVariablesNodeProperty prop = new EnvironmentVariablesNodeProperty(); EnvVars envVars = prop.getEnvVars(); @@ -145,18 +145,18 @@ public void tearDown() throws Exception { storeDummyManager(null); } - private void storeDummyManager(SauceConnectFourManager sauceConnectFourManager) throws Exception { + private void storeDummyManager(SauceConnectManager sauceConnectManager) throws Exception { HudsonSauceManagerFactory factory = HudsonSauceManagerFactory.getInstance(); - Field field = HudsonSauceManagerFactory.class.getDeclaredField("sauceConnectFourManager"); + Field field = HudsonSauceManagerFactory.class.getDeclaredField("sauceConnectManager"); field.setAccessible(true); - field.set(factory, sauceConnectFourManager); + field.set(factory, sauceConnectManager); } /** Verifies that environment variables are resolved for the Sauce Connect options. */ @Test public void resolveVariables() throws Exception { - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -170,12 +170,12 @@ public Process openConnection( String sauceConnectPath) { assertEquals( "Variable not resolved", - "-i 1 -x https://saucelabs.com/rest/v1", + "-i 1 --region us-west", options); // null reverts to default US_WEST return null; } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); SauceOnDemandBuildWrapper sauceBuildWrapper = new TestSauceOnDemandBuildWrapper(credentialsId); sauceBuildWrapper.setOptions("-i ${BUILD_NUMBER}"); @@ -186,8 +186,8 @@ public Process openConnection( /** Verifies that common options are set when the build is run. */ @Test public void commonOptions() throws Exception { - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -202,11 +202,11 @@ public Process openConnection( assertEquals( "Variables are resolved correctly", options, - "-i 1 -x https://saucelabs.com/rest/v1"); // null reverts to default US + "-i 1 --region us-west"); // null reverts to default US return null; } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); SauceOnDemandBuildWrapper sauceBuildWrapper = new TestSauceOnDemandBuildWrapper(credentialsId); PluginImpl plugin = PluginImpl.get(); assertNotNull(plugin); @@ -220,8 +220,8 @@ public Process openConnection( /** Verifies that the options should be common/admin => build => generated */ @Test public void resolvedOptionsOrder() throws Exception { - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -242,7 +242,7 @@ public Process openConnection( return null; } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); SauceOnDemandBuildWrapper sauceBuildWrapper = new TestSauceOnDemandBuildWrapper(credentialsId); PluginImpl plugin = PluginImpl.get(); assertNotNull(plugin); @@ -257,8 +257,8 @@ public Process openConnection( /** Simulates the handling of a Sauce Connect time out. */ @Test public void sauceConnectTimeOut() throws Exception { - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -274,7 +274,7 @@ public Process openConnection( throw new SauceConnectDidNotStartException("Sauce Connect failed to start"); } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); SauceOnDemandBuildWrapper sauceBuildWrapper = new TestSauceOnDemandBuildWrapper(credentialsId); FreeStyleBuild build = runFreestyleBuild(sauceBuildWrapper, null, "sauceConnectTimeOut"); @@ -308,8 +308,8 @@ public void newPortIsGeneratedWhenManagingSauceConnect() throws Exception { sauceBuildWrapper.setUseGeneratedTunnelIdentifier(true); final JSONObject holder = new JSONObject(); - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -326,7 +326,7 @@ public Process openConnection( } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); SauceBuilder sauceBuilder = new SauceBuilder() { @Override @@ -367,8 +367,8 @@ public void providingPortWithEnvVariableStartsUpOnThatPort() throws Exception { sauceBuildWrapper.setSeleniumPort("$TEST_PORT_VARIABLE_4321"); final JSONObject holder = new JSONObject(); - SauceConnectFourManager sauceConnectFourManager = - new SauceConnectFourManager() { + SauceConnectManager sauceConnectManager = + new SauceConnectManager() { @Override public Process openConnection( String username, @@ -385,7 +385,7 @@ public Process openConnection( } }; - storeDummyManager(sauceConnectFourManager); + storeDummyManager(sauceConnectManager); SauceBuilder sauceBuilder = new SauceBuilder() { @Override diff --git a/src/test/resources/builds_by_name.json b/src/test/resources/builds_by_name.json index aaa74f38..313997e1 100644 --- a/src/test/resources/builds_by_name.json +++ b/src/test/resources/builds_by_name.json @@ -1,9 +1,9 @@ { "builds":[ { - "creation_time":1646748603, - "deletion_time":null, - "end_time":1646748751, + "creationTime":1646748603, + "deletionTime":null, + "endTime":1646748751, "group_id":null, "id":"4a9e620d09543f428177d87fdd5a1451", "jobs":{ @@ -16,14 +16,14 @@ "queued":0, "running":0 }, - "modification_time":1646748740, + "modificationTime":1646748740, "name":"build-rdc-test-20220308-141001", "org_id":"4cc95cd249234be19f0509d96e269aa8", "owner_id":"90a6e444fbc04e54b997b04ff17e0e7c", "passed":null, "public":false, "run":0, - "start_time":1646748603, + "startTime":1646748603, "status":"failed", "team_id":"0167a85c614446deb9401698c803ad7a" }