Add test for JENKINS-18341
Fix JENKINS-18341