Skip to content

Commit

Permalink
Remove CustomJenkinsFacade (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Jan 30, 2022
1 parent e4ea915 commit a22f047
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.289.x</artifactId>
<version>1090.v0a_33df40457a_</version>
<version>1135.va_4eeca_ea_21c1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.microsoft.jenkins.containeragents.util.AzureContainerUtils;
import com.microsoft.jenkins.containeragents.util.Constants;
import com.microsoft.jenkins.containeragents.util.DockerRegistryUtils;
import com.microsoft.jenkins.containeragents.util.CustomJenkinsFacade;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.EnvVars;
import hudson.model.ItemGroup;
Expand All @@ -43,15 +42,13 @@ public final class AciDeploymentTemplateBuilder {
= "/com/microsoft/jenkins/containeragents/aci/deployTemplate.json";

private final JenkinsFacade jenkins;
private final CustomJenkinsFacade customJenkinsFacade;

public AciDeploymentTemplateBuilder() {
this(new JenkinsFacade(), new CustomJenkinsFacade());
this(new JenkinsFacade());
}

AciDeploymentTemplateBuilder(JenkinsFacade jenkins, CustomJenkinsFacade customJenkinsFacade) {
AciDeploymentTemplateBuilder(JenkinsFacade jenkins) {
this.jenkins = jenkins;
this.customJenkinsFacade = customJenkinsFacade;
}

@NonNull
Expand All @@ -77,8 +74,7 @@ public AciDeploymentTemplate buildDeploymentTemplate(AciCloud cloud, AciContaine
}
variables.put("cpu", template.getCpu());
variables.put("memory", template.getMemory());
variables.put("jenkinsInstance",
customJenkinsFacade.getLegacyInstanceId());
variables.put("jenkinsInstance", jenkins.getLegacyInstanceId());

addLogAnalytics(tmp, parameters, mapper, cloud);
addCommandNode(tmp, template.getCommand(), agent);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.microsoft.jenkins.containeragents.aci.AciCloud;
import com.microsoft.jenkins.containeragents.aci.AciContainerTemplate;
import com.microsoft.jenkins.containeragents.aci.AciPrivateIpAddress;
import com.microsoft.jenkins.containeragents.util.CustomJenkinsFacade;
import hudson.slaves.RetentionStrategy;
import hudson.slaves.SlaveComputer;
import io.jenkins.plugins.util.JenkinsFacade;
Expand All @@ -31,10 +30,10 @@ public void setup(){
SlaveComputer slaveMock = mock(SlaveComputer.class);
when(agentMock.getComputer()).thenReturn(slaveMock);

CustomJenkinsFacade customJenkinsFacadeMock = mock(CustomJenkinsFacade.class);
when(customJenkinsFacadeMock.getLegacyInstanceId()).thenReturn("instanceId");
JenkinsFacade jenkinsFacade = mock(JenkinsFacade.class);
when(jenkinsFacade.getLegacyInstanceId()).thenReturn("instanceId");

builderUnderTest = new AciDeploymentTemplateBuilder(mock(JenkinsFacade.class), customJenkinsFacadeMock);
builderUnderTest = new AciDeploymentTemplateBuilder(jenkinsFacade);
}

@Test
Expand Down

0 comments on commit a22f047

Please sign in to comment.