Skip to content

Commit

Permalink
fix #202 format exec list for adhoc should work
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Jun 20, 2019
1 parent 1ac2dec commit 82deb0b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public Map getInfoMap(RdClientConfig config) {
map.put("href", getHref());
map.put("status", getStatus());
map.put("project", getProject());
map.put("job", getJob().toMap());
if(null!=getJob()) {
map.put("job", getJob().toMap());
}
map.put("user", getUser());
map.put("serverUUID", getServerUUID());
map.put("dateStarted", null != getDateStarted() ? getDateStarted().format(config.getDateFormat()) : null);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.rundeck.client.api.model

import org.rundeck.client.util.RdClientConfig
import spock.lang.Specification
import spock.lang.Unroll
import sun.security.util.AuthResources_fr

class ExecutionSpec extends Specification {
@Unroll
def "get info map has job #hasJob"() {
given:
def jobmap = [
id : 'jobid',
name : 'jobname',
group : 'agroup',
project : 'aproject',
description : 'blah',
href : 'http://href',
permalink : 'http://permalink',
averageDuration: 123l
]
def job = hasJob ? new JobItem(jobmap) : null
def e = new Execution(id: '1', href: 'http://no', description: '', job: job)
def config = Mock(RdClientConfig)
when:
def result = e.getInfoMap(config)
then:
result
where:
hasJob << [true, false]
}
}

0 comments on commit 82deb0b

Please sign in to comment.