mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
0d87348c21
and reset default cache rule.
35 lines
888 B
Groovy
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()
|
|
}
|
|
}
|
|
}
|
|
}
|