mirror of
https://github.com/Fishwaldo/rundeck-api-java-client.git
synced 2025-07-13 08:28:19 +00:00
Add delete all job executions endpoint
This commit is contained in:
parent
e092ccdb13
commit
a598c76d8e
4 changed files with 108 additions and 3 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue