Package org.openrewrite.test
Interface RewriteTest
- All Superinterfaces:
Iterable<SourceSpec<?>>,SourceSpecs
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertContentEquals(org.openrewrite.SourceFile sourceFile, String expected, String actual, String errorMessagePrefix) default voidCheck that all recipes loadable from the runtime classpath containing the test's package are configurable and run with an empty source file set.default voidassertRecipesConfigure(String packageName) Check that all recipes loadable from the runtime classpath containing the provided package name are configurable and run with an empty source file set.default org.openrewrite.ExecutionContextdefaultExecutionContext(SourceSpec<?>[] sourceSpecs) default voiddefaults(RecipeSpec spec) default @Nullable Stringstatic org.openrewrite.RecipefromRuntimeClasspath(String recipe) default Iterator<SourceSpec<?>>iterator()default voidrewriteRun(Consumer<RecipeSpec> spec, SourceSpec<?>... sourceSpecs) default voidrewriteRun(Consumer<RecipeSpec> spec, SourceSpecs... sourceSpecs) default voidrewriteRun(SourceSpec<?>... sources) default voidrewriteRun(SourceSpecs... sourceSpecs) static AdHocRecipetoRecipe()static AdHocRecipetoRecipe(Function<org.openrewrite.Recipe, org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext>> visitor) static AdHocRecipedefault voidvalidateRecipeNameAndDescription(org.openrewrite.Recipe recipe) default voidvalidateRecipeOptions(org.openrewrite.Recipe recipe) Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
toRecipe
static AdHocRecipe toRecipe(Supplier<org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext>> visitor) -
toRecipe
-
toRecipe
static AdHocRecipe toRecipe(Function<org.openrewrite.Recipe, org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext>> visitor) -
fromRuntimeClasspath
-
assertRecipesConfigure
Check that all recipes loadable from the runtime classpath containing the provided package name are configurable and run with an empty source file set.- Parameters:
packageName- The package name to scan for recipes in.
-
assertRecipesConfigure
default void assertRecipesConfigure()Check that all recipes loadable from the runtime classpath containing the test's package are configurable and run with an empty source file set. -
doesNotExist
- Returns:
- always null, a method that better documents in code that a source file does not exist either before or after a recipe run.
-
defaults
-
rewriteRun
-
rewriteRun
-
rewriteRun
-
assertContentEquals
-
rewriteRun
-
defaultExecutionContext
-
iterator
- Specified by:
iteratorin interfaceIterable<SourceSpec<?>>
-
validateRecipeNameAndDescription
default void validateRecipeNameAndDescription(org.openrewrite.Recipe recipe) -
validateRecipeOptions
default void validateRecipeOptions(org.openrewrite.Recipe recipe)
-