mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-02-19 19:44:27 +02:00
add test template
This commit is contained in:
parent
ea52941ebf
commit
f0d1f60e23
34
template/StepTestTemplateTest.groovy
Normal file
34
template/StepTestTemplateTest.groovy
Normal file
@ -0,0 +1,34 @@
|
||||
#!groovy
|
||||
import com.lesfurets.jenkins.unit.BasePipelineTest
|
||||
|
||||
import static org.junit.Assert.assertEquals
|
||||
import static org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.RuleChain
|
||||
|
||||
import util.Rules
|
||||
import util.JenkinsStepRule
|
||||
|
||||
class StepTestTemplateTest extends BasePipelineTest {
|
||||
private JenkinsStepRule jsr = new JenkinsStepRule(this)
|
||||
|
||||
@Rule
|
||||
public RuleChain rules = Rules
|
||||
.getCommonRules(this)
|
||||
.around(jsr)
|
||||
|
||||
@Before
|
||||
void init() throws Exception {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testStepTestTemplate() throws Exception {
|
||||
jsr.step.call()
|
||||
// asserts
|
||||
assertEquals(true != false)
|
||||
assertTrue(true)
|
||||
assertJobStatusSuccess()
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user