Skip to content

Commit

Permalink
Add testRuntimeOnly for now, with TODO on Refaster classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Dec 20, 2024
1 parent 3fec5a5 commit 272b816
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ recipeDependencies {
}

dependencies {
compileOnly("log4j:log4j:1.+") {
because("log4j 1 has critical vulnerabilities but we need the type for the refaster recipe during compilation")
}

compileOnly("org.projectlombok:lombok:latest.release")
annotationProcessor("org.projectlombok:lombok:latest.release")

Expand All @@ -44,6 +40,11 @@ dependencies {
exclude("com.google.auto.service", "auto-service-annotations")
}

compileOnly("log4j:log4j:1.+") {
because("log4j 1 has critical vulnerabilities but we need the type for the refaster recipe during compilation")
}
testRuntimeOnly("log4j:log4j:1.+") // Necessary to match for now; explore alternatives for Refaster classpath in the future

testImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
testImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
Expand All @@ -54,4 +55,3 @@ dependencies {
testImplementation("org.openrewrite:rewrite-java-tck")

testImplementation("org.assertj:assertj-core:latest.release")
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;
import org.openrewrite.InMemoryExecutionContext;
import org.openrewrite.Issue;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
Expand All @@ -35,8 +34,7 @@ class Log4j1ToLog4j2Test implements RewriteTest {
@Override
public void defaults(RecipeSpec spec) {
spec.recipeFromResource("/META-INF/rewrite/log4j.yml", "org.openrewrite.java.logging.log4j.Log4j1ToLog4j2")
.parser(JavaParser.fromJavaVersion()
.classpathFromResources(new InMemoryExecutionContext(), "log4j-1.2"));
.parser(JavaParser.fromJavaVersion().classpath("log4j"));
}

@DocumentExample
Expand Down

0 comments on commit 272b816

Please sign in to comment.