Added ability to check gerrit change approvals

Change-Id: I912d12d019c4cce561ea256f96966b62086ee45e
diff --git a/src/com/mirantis/mk/Gerrit.groovy b/src/com/mirantis/mk/Gerrit.groovy
index 99fd8a0..c2e7519 100644
--- a/src/com/mirantis/mk/Gerrit.groovy
+++ b/src/com/mirantis/mk/Gerrit.groovy
@@ -181,6 +181,20 @@
         return false
     }
 }
+/**
+ * Returns boolean result of test given gerrit change for given approval type and value
+ * @param gerritChange user gerrit change
+ * @param approvalType type of tested approval (optional, default Verified)
+ * @param approvalValue value of tested approval (optional, default 1)
+ * @return boolean result
+ */
+def changeHasApproval(gerritChange, approvalType="Verified", approvalValue="1"){
+  if(gerritChange.currentPatchSet && gerritChange.currentPatchSet.approvals){
+    def numberOfVerified = gerritChange.currentPatchSet.approvals.stream().filter{ approval -> approval.type.equals(approvalType) && approval.value.equals(approvalValue)}.collect(java.util.stream.Collectors.counting());
+    return numberOfVerified > 0;
+  }
+  return false
+}
 
 @NonCPS
 def _getGerritParamsFromUrl(gitUrl){