Introduce step helper

This commit is contained in:
Marcus Holl
2019-03-29 16:42:18 +01:00
parent ec58986ac5
commit 463bdfabaa
2 changed files with 16 additions and 7 deletions
+1 -7
View File
@@ -4,6 +4,7 @@ import static org.hamcrest.Matchers.equalTo
import static org.hamcrest.Matchers.is
import static org.junit.Assert.assertThat
import static org.junit.Assert.fail
import static util.StepHelper.getSteps
import java.io.File;
import java.util.stream.Collectors
@@ -241,11 +242,4 @@ public class CommonStepsTest extends BasePiperTest{
assertThat("Steps with call methods with return types other than void: ${stepsWithCallMethodsOtherThanVoid}",
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
}
}
+15
View File
@@ -0,0 +1,15 @@
package util;
import java.util.List;
import groovy.io.FileType
public class StepHelper {
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
}
}