use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ElasticAgentPluginRegistryTest method shouldTalkToExtensionToCreateElasticAgent.
@Test
public void shouldTalkToExtensionToCreateElasticAgent() {
final Map<String, String> configuration = Collections.singletonMap("GoServerURL", "foo");
final JobIdentifier jobIdentifier = new JobIdentifier();
final String autoRegisterKey = "auto-register-key";
final String environment = "test-env";
elasticAgentPluginRegistry.createAgent(PLUGIN_ID, autoRegisterKey, environment, configuration, jobIdentifier);
verify(elasticAgentExtension, times(1)).createAgent(PLUGIN_ID, autoRegisterKey, environment, configuration, jobIdentifier);
verifyNoMoreInteractions(elasticAgentExtension);
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ElasticAgentExtensionConverterV2Test method setUp.
@Before
public void setUp() throws Exception {
jobIdentifier = new JobIdentifier("test-pipeline", 1, "Test Pipeline", "test-stage", "1", "test-job");
jobIdentifier.setBuildId(100L);
converterV2 = new ElasticAgentExtensionConverterV2();
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ArtifactsServiceTest method shouldConvertArtifactPathWithLocationToUrl.
@Test
public void shouldConvertArtifactPathWithLocationToUrl() throws Exception {
File artifactsRoot = temporaryFolder.newFolder();
assumeArtifactsRoot(artifactsRoot);
ArtifactsService artifactsService = new ArtifactsService(resolverService, stageService, artifactsDirHolder, zipUtil, systemService);
JobIdentifier identifier = JobIdentifierMother.jobIdentifier("p", 1, "s", "2", "j");
when(resolverService.actualJobIdentifier(identifier)).thenReturn(identifier);
String url = artifactsService.findArtifactUrl(identifier, "console.log");
assertThat(url, is("/files/p/1/s/2/j/console.log"));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ArtifactsServiceTest method shouldProvideArtifactRootForAJobOnLinux.
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void shouldProvideArtifactRootForAJobOnLinux() throws Exception {
assumeArtifactsRoot(fakeRoot);
ArtifactsService artifactsService = new ArtifactsService(resolverService, stageService, artifactsDirHolder, zipUtil, systemService);
artifactsService.initialize();
JobIdentifier oldId = new JobIdentifier("cruise", 1, "1.1", "dev", "2", "linux-firefox", null);
when(resolverService.actualJobIdentifier(oldId)).thenReturn(new JobIdentifier("cruise", 2, "2.2", "functional", "3", "mac-safari"));
String artifactRoot = artifactsService.findArtifactRoot(oldId);
assertThat(artifactRoot, is("pipelines/cruise/2/functional/3/mac-safari"));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ArtifactsServiceTest method shouldConvertArtifactPathToUrl.
@Test
public void shouldConvertArtifactPathToUrl() throws Exception {
File artifactsRoot = temporaryFolder.newFolder();
assumeArtifactsRoot(artifactsRoot);
ArtifactsService artifactsService = new ArtifactsService(resolverService, stageService, artifactsDirHolder, zipUtil, systemService);
JobIdentifier identifier = JobIdentifierMother.jobIdentifier("p", 1, "s", "2", "j");
when(resolverService.actualJobIdentifier(identifier)).thenReturn(identifier);
String url = artifactsService.findArtifactUrl(identifier);
assertThat(url, is("/files/p/1/s/2/j"));
}
Aggregations