use of com.thoughtworks.go.matchers.UploadEntry in project gocd by gocd.
the class BuildWorkArtifactUploadingTest method shouldReportUploadFailuresWhenTheyHappen.
@Test
public void shouldReportUploadFailuresWhenTheyHappen() throws Exception {
ArtifactPlans artifactPlans = new ArtifactPlans();
artifactPlans.add(new ArtifactPlan("**/*.png", "mypic"));
BuildAssignment buildAssigment = createAssignment(artifactPlans, new String[] { "logs/pic/pass.png", "logs/pic-1/pass.png" });
BuildWork work = new BuildWork(buildAssigment);
GoArtifactsManipulatorStub manipulator = new GoArtifactsManipulatorStub(new ArrayList<>(), new ArrayList<>(), new HttpServiceStub(), new URLService(), new ZipUtilThatRunsOutOfMemory());
AgentIdentifier agentIdentifier = new AgentIdentifier("somename", "127.0.0.1", AGENT_UUID);
work.doWork(agentIdentifier, new FakeBuildRepositoryRemote(), manipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
List<UploadEntry> entries = manipulator.uploadEntries();
assertThat(entries.isEmpty(), is(true));
assertThat(manipulator.consoleOut(), containsString("Failed to upload [**/*.png]"));
}
Aggregations