use of com.thoughtworks.go.agent.testhelpers.FakeBuildRepositoryRemote in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method doWorkWithMaterials.
private EnvironmentVariableContext doWorkWithMaterials(Materials materials) throws IOException {
pipelineConfig.setMaterialConfigs(materials.convertToConfigs());
BuildAssignment buildAssigment = createAssignment(null);
BuildWork work = new BuildWork(buildAssigment, StandardCharsets.UTF_8.name());
EnvironmentVariableContext environmentVariableContext = new EnvironmentVariableContext();
AgentIdentifier agentIdentifier = new AgentIdentifier("somename", "127.0.0.1", AGENT_UUID);
work.doWork(environmentVariableContext, new AgentWorkContext(agentIdentifier, new FakeBuildRepositoryRemote(), new GoArtifactsManipulatorStub(), new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie"), packageRepositoryExtension, scmExtension, taskExtension, null, null));
return environmentVariableContext;
}
use of com.thoughtworks.go.agent.testhelpers.FakeBuildRepositoryRemote in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldUseSvnMaterialNameIfPresent.
@Test
public void shouldUseSvnMaterialNameIfPresent() throws IOException {
svnMaterial.setName(new CaseInsensitiveString("Cruise"));
pipelineConfig.setMaterialConfigs(new MaterialConfigs(svnMaterial.config()));
BuildAssignment buildAssigment = createAssignment(null);
BuildWork work = new BuildWork(buildAssigment, StandardCharsets.UTF_8.name());
EnvironmentVariableContext environmentVariableContext = new EnvironmentVariableContext();
new SystemEnvironment().setProperty("serviceUrl", "some_random_place");
AgentIdentifier agentIdentifier = new AgentIdentifier("somename", "127.0.0.1", AGENT_UUID);
work.doWork(environmentVariableContext, new AgentWorkContext(agentIdentifier, new FakeBuildRepositoryRemote(), new GoArtifactsManipulatorStub(), new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie"), packageRepositoryExtension, scmExtension, taskExtension, null, null));
assertThat(environmentVariableContext.getProperty("GO_REVISION_CRUISE"), is("3"));
}
Aggregations