Skip to content

Commit

Permalink
Merge pull request #744 from daspilker/JENKINS-32598
Browse files Browse the repository at this point in the history
[JENKINS-32598] fixed NPE when checking available permissions
  • Loading branch information
daspilker committed Feb 12, 2016
2 parents 888080e + 496219b commit c4c8244
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/Home.md
Expand Up @@ -45,6 +45,8 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
([#724](https://github.com/jenkinsci/job-dsl-plugin/pull/724))
* Fixed support for scripts in directories when using the command line runner
([#740](https://github.com/jenkinsci/job-dsl-plugin/pull/740))
* Fixed NPE when checking available permissions
([JENKINS-32598](https://issues.jenkins-ci.org/browse/JENKINS-32598))
* Enhanced support for the [Notification Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin)
([#741](https://github.com/jenkinsci/job-dsl-plugin/pull/741))
* Built-in support for the
Expand Down
Expand Up @@ -97,7 +97,7 @@ abstract class MockJobManagement extends AbstractJobManagement {

@Override
Set<String> getPermissions(String authorizationMatrixPropertyClassName) {
permissions[authorizationMatrixPropertyClassName]
permissions[authorizationMatrixPropertyClassName] ?: []
}

@Override
Expand Down
Expand Up @@ -26,6 +26,15 @@ class MockJobManagementSpec extends Specification {
'hudson.scm.SCM.Tag' in permissions
}

def 'job permissions are never null'() {
when:
Set<String> permissions = mockJobManagement.getPermissions('someClass')

then:
permissions != null
permissions.empty
}

def 'queueJob validates name argument'() {
when:
mockJobManagement.queueJob(name)
Expand Down

0 comments on commit c4c8244

Please sign in to comment.