generated from devs-from-matrix/basic-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: bump cucumber to 7 and used junit bom
The CucumberContextConfiguration does not work well with lambda's (cucumber-java8) hence I had to extract the configuration out of the stepdef as suggested in cucumber/cucumber-jvm#2413 Signed-off-by: Paul Williams <[email protected]>
- Loading branch information
1 parent
61ddb83
commit 0076e50
Showing
5 changed files
with
42 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
acceptance-test/src/test/java/packagename/cucumber/ExampleStepDef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 17 additions & 9 deletions
26
acceptance-test/src/test/java/packagename/cucumber/RunCucumberExampleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
package packagename.cucumber; | ||
|
||
import io.cucumber.junit.Cucumber; | ||
import io.cucumber.junit.CucumberOptions; | ||
import org.junit.runner.RunWith; | ||
import static io.cucumber.junit.platform.engine.Constants.*; | ||
|
||
@RunWith(Cucumber.class) | ||
@CucumberOptions( | ||
features = "classpath:features", | ||
plugin = {"json:target/cucumber/example.json", "json:target/cucumber/example.xml"}, | ||
tags = "@Example", | ||
glue = "classpath:packagename.cucumber") | ||
import org.junit.platform.suite.api.ConfigurationParameter; | ||
import org.junit.platform.suite.api.ConfigurationParameters; | ||
import org.junit.platform.suite.api.IncludeEngines; | ||
import org.junit.platform.suite.api.SelectClasspathResource; | ||
import org.junit.platform.suite.api.Suite; | ||
|
||
@Suite | ||
@IncludeEngines("cucumber") | ||
@SelectClasspathResource("features/example.feature") | ||
@ConfigurationParameters({ | ||
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "packagename.cucumber"), | ||
@ConfigurationParameter(key = FILTER_TAGS_PROPERTY_NAME, value = "@Example"), | ||
@ConfigurationParameter(key = JUNIT_PLATFORM_NAMING_STRATEGY_PROPERTY_NAME, value = "long"), | ||
@ConfigurationParameter(key = PLUGIN_PUBLISH_QUIET_PROPERTY_NAME, value = "true"), | ||
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "json:target/cucumber/cucumber.json") | ||
}) | ||
public class RunCucumberExampleTest {} |
13 changes: 13 additions & 0 deletions
13
acceptance-test/src/test/java/packagename/cucumber/SpringCucumberTestConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package packagename.cucumber; | ||
|
||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; | ||
|
||
import io.cucumber.spring.CucumberContextConfiguration; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import packagename.boot.ExampleApplication; | ||
|
||
@SpringBootTest(classes = ExampleApplication.class, webEnvironment = RANDOM_PORT) | ||
@CucumberContextConfiguration | ||
@ActiveProfiles("test") | ||
public class SpringCucumberTestConfig {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters