I am using cucumber-jvm to perform some functional tests in Kotlin.
I have the standard empty runner class:
@RunWith(Cucumber::class)
@CucumberOptions(features=[foo],
glue=[bar],
plugin=[baz],
strict=true,
monochrome=true)
class Whatever
The actual steps are defined in another class with the @ContextConfiguration springframework annotation. This class also uses other spring features like @Autowire or @Qualifier
@ContextConfiguration(locations=["x/y/z/config.xml"])
class MyClass {
...
@Before
...
@Given("some feature file stuff")
...
// etc
}
This all work fine in cucumber version 4.2.0, however upgrading to version 6.3.0 breaks things. After updating the imports to match the new cucumber project layout the tests now fail with this error:
io.cucumber.core.backend.CucumberBackendException: Please annotate a glue class with some context configuration.
It provides examples of what it means...
For example:
@CucumberContextConfiguration
@SpringBootTest(classes = TestConfig.class)
public class CucumberSpringConfiguration {}
Or:
@CucumberContextConfiguration
@ContextConfiguration( ... )
public class CucumberSpringConfiguration {}
It looks like it's telling me I can just add @CucumberContextConfiguration to MyClass.
But why?
I get the point of @CucumberContextConfiguration, it's explained well here but why do I need it now with version 6 when version 4 got on fine without it? I can't see any feature that was deprecated and replaced by this.
Any help would be appreciated :)