use of com.hp.octane.integrations.dto.connectivity.OctaneTaskAbridged in project octane-ci-java-sdk by MicroFocus.
the class TaskingServiceTests method testRunAPI.
@Test
public void testRunAPI() {
TasksProcessor tasksProcessor = client.getTasksProcessor();
Assert.assertNotNull(tasksProcessor);
OctaneTaskAbridged taskAbridged = dtoFactory.newDTO(OctaneTaskAbridged.class).setId(UUID.randomUUID().toString()).setUrl(OctaneSPEndpointSimulator.getSimulatorUrl() + APIPrefix + "/jobs/job-a/run");
OctaneResultAbridged resultAbridged = tasksProcessor.execute(taskAbridged);
Assert.assertNotNull(resultAbridged);
Assert.assertEquals(HttpStatus.SC_CREATED, resultAbridged.getStatus());
Assert.assertEquals(taskAbridged.getId(), resultAbridged.getId());
Assert.assertEquals(client.getInstanceId(), resultAbridged.getServiceId());
Assert.assertNull(resultAbridged.getBody());
}
use of com.hp.octane.integrations.dto.connectivity.OctaneTaskAbridged in project octane-ci-java-sdk by MicroFocus.
the class TaskingServiceTests method testJobSpecificAPI.
@Test
public void testJobSpecificAPI() {
TasksProcessor tasksProcessor = client.getTasksProcessor();
Assert.assertNotNull(tasksProcessor);
OctaneTaskAbridged taskAbridged = dtoFactory.newDTO(OctaneTaskAbridged.class).setId(UUID.randomUUID().toString()).setUrl(OctaneSPEndpointSimulator.getSimulatorUrl() + APIPrefix + "/jobs/job-a");
OctaneResultAbridged resultAbridged = tasksProcessor.execute(taskAbridged);
runCommonAsserts(resultAbridged, taskAbridged.getId(), HttpStatus.SC_OK);
PipelineNode pipeline = dtoFactory.dtoFromJson(resultAbridged.getBody(), PipelineNode.class);
Assert.assertNotNull(pipeline);
Assert.assertEquals("job-a", pipeline.getJobCiId());
Assert.assertEquals("Job A", pipeline.getName());
Assert.assertNotNull(pipeline.getPhasesInternal());
Assert.assertTrue(pipeline.getPhasesInternal().isEmpty());
Assert.assertNotNull(pipeline.getPhasesPostBuild());
Assert.assertTrue(pipeline.getPhasesPostBuild().isEmpty());
Assert.assertNotNull(pipeline.getParameters());
Assert.assertTrue(pipeline.getParameters().isEmpty());
Assert.assertNull(pipeline.getMultiBranchType());
}
use of com.hp.octane.integrations.dto.connectivity.OctaneTaskAbridged in project octane-ci-java-sdk by MicroFocus.
the class TaskingServiceTests method testJobNoImplementedAPI.
@Test
public void testJobNoImplementedAPI() {
TasksProcessor tasksProcessor = client.getTasksProcessor();
Assert.assertNotNull(tasksProcessor);
OctaneTaskAbridged taskAbridged = dtoFactory.newDTO(OctaneTaskAbridged.class).setId(UUID.randomUUID().toString()).setUrl(OctaneSPEndpointSimulator.getSimulatorUrl() + APIPrefix + "/jobs");
TaskingTestPluginServicesTest.getJobsAPIReturnNull = true;
OctaneResultAbridged resultAbridged = tasksProcessor.execute(taskAbridged);
TaskingTestPluginServicesTest.getJobsAPIReturnNull = false;
runCommonAsserts(resultAbridged, taskAbridged.getId(), HttpStatus.SC_NOT_IMPLEMENTED);
}
use of com.hp.octane.integrations.dto.connectivity.OctaneTaskAbridged in project octane-ci-java-sdk by MicroFocus.
the class TaskingServiceTests method testRunNotImplementedAPI.
@Test
public void testRunNotImplementedAPI() {
TasksProcessor tasksProcessor = client.getTasksProcessor();
Assert.assertNotNull(tasksProcessor);
OctaneTaskAbridged taskAbridged = dtoFactory.newDTO(OctaneTaskAbridged.class).setId(UUID.randomUUID().toString()).setUrl(OctaneSPEndpointSimulator.getSimulatorUrl() + APIPrefix + "/jobs/job-a/run");
TaskingTestPluginServicesTest.runAPINotImplemented = true;
OctaneResultAbridged resultAbridged = tasksProcessor.execute(taskAbridged);
TaskingTestPluginServicesTest.runAPINotImplemented = false;
Assert.assertNotNull(resultAbridged);
Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, resultAbridged.getStatus());
Assert.assertEquals(taskAbridged.getId(), resultAbridged.getId());
Assert.assertEquals(client.getInstanceId(), resultAbridged.getServiceId());
Assert.assertNull(resultAbridged.getBody());
}
Aggregations