Add delete all job executions endpoint

This commit is contained in:
Greg Schueler 2014-11-06 10:05:35 -08:00
parent e092ccdb13
commit a598c76d8e
4 changed files with 108 additions and 3 deletions

View file

@ -1572,6 +1572,42 @@ public class RundeckClientTest {
response.getFailures().get(1).getMessage()
);
}
/**
* delete executions with failure
*/
@Test
@Betamax(tape = "delete_all_job_executions_unauthorized", mode = TapeMode.READ_ONLY)
public void deleteAllJobExecutionsUnauthorized() throws Exception {
final RundeckClient client = createClient(TEST_TOKEN_8, 12);
try {
final DeleteExecutionsResponse response = client.deleteAllJobExecutions(
"764c1209-68ed-4185-8d43-a739364bf156"
);
Assert.fail();
} catch (RundeckApiException.RundeckApiTokenException e) {
e.printStackTrace();
}
}
/**
*
* @throws Exception
*/
@Test
@Betamax(tape = "delete_all_job_executions_success", mode = TapeMode.READ_ONLY)
public void deleteAllJobExecutionsSuccess() throws Exception {
final RundeckClient client = createClient(TEST_TOKEN_8, 12);
final DeleteExecutionsResponse response = client.deleteAllJobExecutions(
"764c1209-68ed-4185-8d43-a739364bf156"
);
Assert.assertEquals(2, response.getRequestCount());
Assert.assertEquals(2, response.getSuccessCount());
Assert.assertEquals(0, response.getFailedCount());
Assert.assertTrue(response.isAllsuccessful());
Assert.assertNotNull(response.getFailures());
Assert.assertEquals(0, response.getFailures().size());
}
/**
* delete single execution success
*/