Add tests for all projects running exec query v8

This commit is contained in:
Greg Schueler 2013-08-21 10:22:48 -07:00
parent 4249dd54bb
commit 46c204b28d
2 changed files with 67 additions and 0 deletions

View file

@ -928,6 +928,23 @@ public class RundeckClientTest {
Assert.assertEquals("test2", exec2.getProject());
}
/**
* Running executions for all projects using API v8, which queries for project list and then individually
* queries each project's now running
* @throws Exception
*/
@Test
@Betamax(tape = "running_executions_v8")
public void runningExecutionsV8() throws Exception {
final RundeckClient client = createClient(TEST_TOKEN_5, 8);
List<RundeckExecution> runningExecutions = client.getRunningExecutions();
Assert.assertEquals(2, runningExecutions.size());
RundeckExecution exec1 = runningExecutions.get(0);
Assert.assertEquals("test", exec1.getProject());
RundeckExecution exec2 = runningExecutions.get(1);
Assert.assertEquals("test2", exec2.getProject());
}
@Before
public void setUp() throws Exception {
// not that you can put whatever here, because we don't actually connect to the RunDeck instance

View file

@ -0,0 +1,50 @@
!tape
name: running_executions_v8
interactions:
- recorded: 2013-08-21T17:18:36.488Z
request:
method: GET
uri: http://rundeck.local:4440/api/8/projects
headers:
Host: rundeck.local:4440
Proxy-Connection: Keep-Alive
User-Agent: RunDeck API Java Client 8
X-RunDeck-Auth-Token: C3O6d5O98Kr6Dpv71sdE4ERdCuU12P6d
response:
status: 200
headers:
Content-Type: text/xml; charset=utf-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Server: Jetty(6.1.21)
Set-Cookie: JSESSIONID=16xd7k6t8tr5m;Path=/
body: <result success='true' apiversion='9'><projects count='2'><project><name>test</name><description></description></project><project><name>test2</name><description></description></project></projects></result>
- recorded: 2013-08-21T17:18:36.647Z
request:
method: GET
uri: http://rundeck.local:4440/api/8/executions/running?project=test
headers:
Host: rundeck.local:4440
Proxy-Connection: Keep-Alive
User-Agent: RunDeck API Java Client 8
X-RunDeck-Auth-Token: C3O6d5O98Kr6Dpv71sdE4ERdCuU12P6d
response:
status: 200
headers:
Content-Type: text/xml; charset=utf-8
Server: Jetty(6.1.21)
body: <result success='true' apiversion='9'><executions count='1'><execution id='120' href='http://dignan:4440/execution/follow/120' status='running' project='test'><user>admin</user><date-started unixtime='1377105497299'>2013-08-21T17:18:17Z</date-started><description>echo asdf; sleep 120</description><argstring/></execution></executions></result>
- recorded: 2013-08-21T17:18:36.865Z
request:
method: GET
uri: http://rundeck.local:4440/api/8/executions/running?project=test2
headers:
Host: rundeck.local:4440
Proxy-Connection: Keep-Alive
User-Agent: RunDeck API Java Client 8
X-RunDeck-Auth-Token: C3O6d5O98Kr6Dpv71sdE4ERdCuU12P6d
response:
status: 200
headers:
Content-Type: text/xml; charset=utf-8
Server: Jetty(6.1.21)
body: <result success='true' apiversion='9'><executions count='1'><execution id='121' href='http://dignan:4440/execution/follow/121' status='running' project='test2'><user>admin</user><date-started unixtime='1377105500838'>2013-08-21T17:18:20Z</date-started><description>echo asdf; sleep 120</description><argstring/></execution></executions></result>