New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cucumber annotation to suite #268
Conversation
runtimeOnly("io.cucumber:cucumber-junit-platform-engine:7.+") | ||
runtimeOnly("org.junit.platform:junit-platform-suite-api:latest.release") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general dependencies necessary for recipe testing should belong to the testRuntimeOnly
group.
src/main/java/org/openrewrite/java/testing/cucumber/CucumberAnnotationToSuite.java
Show resolved
Hide resolved
closed as completed by 50ba449 |
@timtebeek, when you have a chance it would be a good idea to add a @Test
void should_replace_cucumber_annotation_with_suite_with_selected_classpath_resource() {
rewriteRun(
mavenProject("project",
srcTestJava(
java("""
package com.example.app;
import io.cucumber.junit.platform.engine.Cucumber;
@Cucumber
public class CucumberJava8Definitions {
}
""",
"""
package com.example.app;
import org.junit.platform.suite.api.SelectClasspathResource;
import org.junit.platform.suite.api.Suite;
@Suite
@SelectClasspathResource("com/example/app")
public class CucumberJava8Definitions {
}
""")
),
pomXml(
"""
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
</project>
<dependencies>
...
</dependencies>
""",
"""
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
</project>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>1.9.1</version>
<dependency>
</dependencies>
""")
)
);
} |
Hello @timtebeek and @mpkorstanje, |
On second thought, I decided to remove the maven changes from the test to avoid future test failures after the next |
Awesome; thanks a lot for the help, especially throughout the various iterations around testing. That makes #264 ready for a write up; I'll try to squeeze in both a blog and some release notes for Cucumber-JVM. |
Yeah, that would be a nice feature. The maven test is very useful during the development cycle; I had an error in the dependency glob expression which might have gone unnoticed. |
Not sure why I can't replace a single annotation with two annotations from a single template like this. 馃