1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-02-07 13:42:23 +02:00
sap-jenkins-library/test/groovy/util/JenkinsResetDefaultCacheRule.groovy
Marcus Holl e418c15b6e
Revert "Back commonPipelineEnvironment step by shared class (#821)" (#885)
This reverts commit eb57c8df7b9a4b7a9f44ae57f5054303a0c9f74e.
2019-09-26 14:18:18 +02:00

35 lines
888 B
Groovy

package util
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
import com.lesfurets.jenkins.unit.BasePipelineTest
import com.sap.piper.DefaultValueCache
class JenkinsResetDefaultCacheRule implements TestRule {
JenkinsResetDefaultCacheRule() {
this(null)
}
//
// Actually not needed. Only provided for the sake of consistency
// with our other rules which comes with an constructor having the
// test case contained in the signature.
JenkinsResetDefaultCacheRule(BasePipelineTest testInstance) {
}
@Override
Statement apply(Statement base, Description description) {
return new Statement() {
@Override
void evaluate() throws Throwable {
DefaultValueCache.reset()
base.evaluate()
}
}
}
}