use of com.thoughtworks.go.util.HttpService in project gocd by gocd.
the class DownloadActionTest method shouldReturnWithoutRetryingArtifactIsNotModified.
@Test
public void shouldReturnWithoutRetryingArtifactIsNotModified() throws Exception {
fetchHandler = new FileHandler(new File(""), getSrc());
HttpService httpService = mock(HttpService.class);
StubGoPublisher goPublisher = new StubGoPublisher();
when(httpService.download("foo", fetchHandler)).thenReturn(SC_NOT_MODIFIED);
new DownloadAction(httpService, goPublisher, clock).perform("foo", fetchHandler);
verify(httpService).download("foo", this.fetchHandler);
verifyNoMoreInteractions(httpService);
assertThat(goPublisher.getMessage(), containsString("Artifact is not modified, skipped fetching it"));
}
use of com.thoughtworks.go.util.HttpService in project gocd by gocd.
the class GoArtifactsManipulatorTest method setUp.
@Before
public void setUp() throws Exception {
httpService = mock(HttpService.class);
artifactFolder = temporaryFolder.newFolder("artifact_folder");
tempFile = temporaryFolder.newFile("artifact_folder/file.txt");
goArtifactsManipulatorStub = new GoArtifactsManipulatorStub(httpService);
jobIdentifier = new JobIdentifier("pipeline1", 1, "label-1", "stage1", "1", "job1");
AgentRuntimeInfo agentRuntimeInfo = new AgentRuntimeInfo(new AgentIdentifier("h", "1", "u"), AgentRuntimeStatus.Idle, currentWorkingDirectory(), null, false);
goPublisher = new DefaultGoPublisher(goArtifactsManipulatorStub, jobIdentifier, new BuildRepositoryRemoteStub(), agentRuntimeInfo, "utf-8");
}
Aggregations