Solved
Forum Discussion
aaronpliu
7 years agoFrequent Contributor
you defined a closure, if no parameter input, would use {-> }, and then call it sha256.call()
jdario
7 years agoOccasional Contributor
Hello. Thanks for your reply. Apologies for such a late response. I'm ashamed to admit I don't understand your solution. I'm not a developer or technical person at all, but I really want to improve my testing.
I'm assuming you are refering tho the line
def sha256 = {var.java.security.MessageDigest.getInstance("SHA-256").digest(attachment).toString()}
I tried a couple things with no luck.
// I tried this with no luck def sha256 = { [->] var.java.security.MessageDigest.getInstance("SHA-256").digest(attachment).toString() sha256.call() } //Doesnt work either def sha256 = { sha256 -> var.java.security.MessageDigest.getInstance("SHA-256").digest(attachment).toString() sha256.call() }
I came back to this after the holidays and It's turned into a headache.