mirror of
https://github.com/SAP/jenkins-library.git
synced 2026-06-19 22:58:55 +02:00
Reuse getSteps from StepHelper in common step tests
This commit is contained in:
@@ -4,6 +4,7 @@ import static org.hamcrest.Matchers.equalTo
|
|||||||
import static org.hamcrest.Matchers.is
|
import static org.hamcrest.Matchers.is
|
||||||
import static org.junit.Assert.assertThat
|
import static org.junit.Assert.assertThat
|
||||||
import static org.junit.Assert.fail
|
import static org.junit.Assert.fail
|
||||||
|
import static util.StepHelper.getSteps
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.stream.Collectors
|
import java.util.stream.Collectors
|
||||||
@@ -242,11 +243,4 @@ public class CommonStepsTest extends BasePiperTest{
|
|||||||
assertThat("Steps with call methods with return types other than void: ${stepsWithCallMethodsOtherThanVoid}",
|
assertThat("Steps with call methods with return types other than void: ${stepsWithCallMethodsOtherThanVoid}",
|
||||||
stepsWithCallMethodsOtherThanVoid, is(empty()))
|
stepsWithCallMethodsOtherThanVoid, is(empty()))
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getSteps() {
|
|
||||||
List steps = []
|
|
||||||
new File('vars').traverse(type: FileType.FILES, maxDepth: 0)
|
|
||||||
{ if(it.getName().endsWith('.groovy')) steps << (it =~ /vars[\\\/](.*)\.groovy/)[0][1] }
|
|
||||||
return steps
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user