I am testing a Springboot application using cucumber (v7.2.3). I have a feature file to test application using @SpringBootTest and @Suite (from junit-platform) I am using @ConfigurationParameter to refer the package where I have my step definition class.
I also have @DataTableType annotations to convert feature data into java objects, which are in the same package as my step-definitions.
Now I want to have another set of step definitions (in a separate file) which will connect to the application running in dev environment (over REST). I want to re-use my feature files as testing exactly same feature but on a running application.
I tried to create a new step definition java class in a different package and placed existing step definition java class in another package, but feature data to java object creation failed. Probably cucumber is expecting to have class which has @DataTableType annotations in the same package as step definition class.
Any idea how can I achieve 2 different step definitions using same feature file.
Note: I want to run local step definitions to run as part of maven build and remote step definitions as post deployment task. Please also guide how can I achieve that (probably using tags).
Versions used junit-platform - 1.8.2 junit-jupiter - 5.8.2 springboot - 2.7.4