[KARAF-2910]add a testcase
(cherry picked from commit 70d14e6e10560e5128a9637b3d135948aa42c1ce)