Skip to content

Commit

Permalink
Update preconditions hint in yaml recipes (#3725)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Nov 22, 2023
1 parent a9ab03f commit 1055b33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void commentOutApplicabilityTest() {
description: x.
tags:
- testing
# Applicability tests are no longer supported for yaml recipes, please remove or require migrating the recipe to Java code
# Applicability tests are no longer supported for yaml recipes, please move to using preconditions
# applicability:
# anySource:
# - org.openrewrite.java.testing.mockito.UsesMockitoAll
Expand Down Expand Up @@ -94,7 +94,7 @@ void commentOutSingleSourceApplicability() {
description: x.
tags:
- testing
# Applicability tests are no longer supported for yaml recipes, please remove or require migrating the recipe to Java code
# Applicability tests are no longer supported for yaml recipes, please move to using preconditions
# applicability:
# singleSource:
# - org.openrewrite.java.testing.mockito.UsesMockitoAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public String getDisplayName() {

@Override
public String getDescription() {
return "Remove the applicability test from the YAML recipe when migrating from Rewrite 7 to 8, as it is no " +
"longer supported and may require migrating the recipe to Java code.";
return "Remove the applicability test from the YAML recipe when migrating from Rewrite 7 to 8, " +
"as these have been replaced by preconditions.";
}

@Override
Expand Down Expand Up @@ -68,8 +68,7 @@ public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionC
}
};

String commentText = "Applicability tests are no longer supported for yaml recipes, please remove or require " +
"migrating the recipe to Java code";
String commentText = "Applicability tests are no longer supported for yaml recipes, please move to using preconditions";
return Preconditions.check(yamlRecipeCheckVisitor, new CommentOutProperty("applicability",
commentText).getVisitor());
}
Expand Down

0 comments on commit 1055b33

Please sign in to comment.