Fixing JENKINS-22750, regression introduced in JENKINS-21394

We have fixed the regression introduced in JENKINS22750, and i have correspondingly written a unit test to demonstrate that the job in fact gets queued on the master.