mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
8a019f5b86
read yaml rule is a very frequently used rule. But having the rule in the common rules means we cannot register text or files to that rule, which makes it less handy to work with yaml files in the tests.
21 lines
660 B
Groovy
21 lines
660 B
Groovy
package util
|
|
|
|
import org.junit.rules.RuleChain
|
|
|
|
import com.lesfurets.jenkins.unit.BasePipelineTest
|
|
import com.lesfurets.jenkins.unit.global.lib.LibraryConfiguration
|
|
|
|
public class Rules {
|
|
|
|
public static RuleChain getCommonRules(BasePipelineTest testCase) {
|
|
return getCommonRules(testCase, null)
|
|
}
|
|
|
|
public static RuleChain getCommonRules(BasePipelineTest testCase, LibraryConfiguration libConfig) {
|
|
return RuleChain.outerRule(new JenkinsSetupRule(testCase, libConfig))
|
|
.around(new JenkinsResetDefaultCacheRule())
|
|
.around(new JenkinsErrorRule(testCase))
|
|
.around(new JenkinsEnvironmentRule(testCase))
|
|
}
|
|
}
|