Fixed groovy testing pipeline

Change-Id: Id295da217213e61e6b22e3af0dd428d5ec4d4e8f
diff --git a/test-groovy-pipeline.groovy b/test-groovy-pipeline.groovy
index 10d8ece..66e0393 100644
--- a/test-groovy-pipeline.groovy
+++ b/test-groovy-pipeline.groovy
@@ -19,8 +19,9 @@
         }
         stage ('Run Codenarc tests'){
             def workspace = common.getWorkspace()
-            def gradle_report = sh (script: "docker run --rm -v ${workspace}:/usr/bin/app:rw ${GRADLE_IMAGE} ${GRADLE_CMD}",
-                                    returnStdout: true).trim()
+            def jenkinsUID = common.getJenkinsUid()
+            def jenkinsGID = common.getJenkinsGid()
+            def gradle_report = sh (script: "docker run --rm -v ${workspace}:/usr/bin/app:rw -u ${jenkinsUID}:${jenkinsGID} ${GRADLE_IMAGE} ${GRADLE_CMD}", returnStdout: true).trim()
             // Compilation failure doesn't fail the build
             // Check gradle output explicitly
             common.infoMsg(gradle_report)