diff --git a/src/test/java/io/jenkins/plugins/jfrog/integration/PipelineTestBase.java b/src/test/java/io/jenkins/plugins/jfrog/integration/PipelineTestBase.java index 6219e16e..8d8c748a 100644 --- a/src/test/java/io/jenkins/plugins/jfrog/integration/PipelineTestBase.java +++ b/src/test/java/io/jenkins/plugins/jfrog/integration/PipelineTestBase.java @@ -68,7 +68,6 @@ public class PipelineTestBase { static final String JFROG_CLI_TOOL_NAME_1 = "jfrog-cli"; static final String JFROG_CLI_TOOL_NAME_2 = "jfrog-cli-2"; static final String TEST_CONFIGURED_SERVER_ID = "serverId"; - static final String TEST_CONFIGURED_SERVER_ID2 = "serverId2"; // Set up jenkins and configure latest JFrog CLI. public void initPipelineTest(JenkinsRule jenkins) throws Exception { @@ -163,8 +162,11 @@ private void setGlobalConfiguration() throws IOException { Assert.assertNotNull(jfrogBuilder); CredentialsConfig platformCred = new CredentialsConfig(Secret.fromString(ARTIFACTORY_USERNAME), Secret.fromString(ARTIFACTORY_PASSWORD), Secret.fromString(ACCESS_TOKEN), "credentials"); List artifactoryServers = new ArrayList<>() {{ + // Dummy server to test multiple configured servers. + // The dummy server should be configured first to ensure the right server is being used (and not the first one). + // platformCred cannot be empty since it is used to config the server. + add(new JFrogPlatformInstance("dummyServerId", "http://not-a-real-platform", platformCred, ARTIFACTORY_URL, "", "")); add(new JFrogPlatformInstance(TEST_CONFIGURED_SERVER_ID, PLATFORM_URL, platformCred, ARTIFACTORY_URL, "", "")); - add(new JFrogPlatformInstance(TEST_CONFIGURED_SERVER_ID2, PLATFORM_URL, platformCred, ARTIFACTORY_URL, "", "")); }}; jfrogBuilder.setJfrogInstances(artifactoryServers); Jenkins.get().getDescriptorByType(JFrogPlatformBuilder.DescriptorImpl.class).setJfrogInstances(artifactoryServers);