improve unit test
[FIXED JENKINS-18957] NPE due to unset credentialsProvider