Skip to content

Commit

Permalink
refactor: OpenRewrite best practices (openrewrite#4329)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek and TeamModerne authored Jul 15, 2024
1 parent 0fb7071 commit d9e0609
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.openrewrite.gradle;

import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

Expand All @@ -29,6 +30,7 @@ public void defaults(RecipeSpec spec) {
spec.recipe(new DependencyConstraintToRule());
}

@DocumentExample
@Test
void newResolutionStrategyBlock() {
rewriteRun(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package org.openrewrite.java.search;

import org.intellij.lang.annotations.Language;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.ExpectedToFail;
import org.junitpioneer.jupiter.cartesian.CartesianTest;
import org.openrewrite.java.JavaIsoVisitor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;
import org.openrewrite.marker.SearchResult;
import org.openrewrite.test.RewriteTest;

Expand All @@ -28,6 +29,7 @@

class LiteralTest implements RewriteTest {

@DocumentExample
@Test
void numericLiteral() {
rewriteRun(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.openrewrite.java.trait;

import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;
import org.openrewrite.Recipe;
import org.openrewrite.java.MethodMatcher;
import org.openrewrite.marker.SearchResult;
Expand All @@ -35,6 +36,7 @@ public void defaults(RecipeSpec spec) {
new MethodMatcher("java.util.List add(..)", true))));
}

@DocumentExample
@Test
void methodAccesses() {
rewriteRun(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.openrewrite.java.trait;

import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;
import org.openrewrite.Recipe;
import org.openrewrite.marker.SearchResult;
import org.openrewrite.test.RecipeSpec;
Expand All @@ -34,6 +35,7 @@ public void defaults(RecipeSpec spec) {
spec.recipe(markVariableAccesses(variableAccess()));
}

@DocumentExample
@Test
void variableAccesses() {
rewriteRun(
Expand Down

0 comments on commit d9e0609

Please sign in to comment.