Interface RewriteTest

All Superinterfaces:
Iterable<SourceSpec<?>>, SourceSpecs

public interface RewriteTest extends SourceSpecs
  • Method Details

    • toRecipe

      static AdHocRecipe toRecipe(Supplier<org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>> visitor)
    • toRecipe

      static AdHocRecipe toRecipe()
    • toRecipe

      static AdHocRecipe toRecipe(Function<org.openrewrite.Recipe,org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>> visitor)
    • fromRuntimeClasspath

      static org.openrewrite.Recipe fromRuntimeClasspath(String recipe)
    • assertRecipesConfigure

      default void assertRecipesConfigure(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.
      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

      default @Nullable String 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

      default void defaults(RecipeSpec spec)
    • rewriteRun

      default void rewriteRun(SourceSpecs... sourceSpecs)
    • rewriteRun

      default void rewriteRun(Consumer<RecipeSpec> spec, SourceSpecs... sourceSpecs)
    • rewriteRun

      default void rewriteRun(Consumer<RecipeSpec> spec, SourceSpec<?>... sourceSpecs)
    • assertContentEquals

      static void assertContentEquals(org.openrewrite.SourceFile sourceFile, String expected, String actual, String errorMessagePrefix)
    • rewriteRun

      default void rewriteRun(SourceSpec<?>... sources)
    • defaultExecutionContext

      default org.openrewrite.ExecutionContext defaultExecutionContext(SourceSpec<?>[] sourceSpecs)
    • iterator

      default Iterator<SourceSpec<?>> iterator()
      Specified by:
      iterator in interface Iterable<SourceSpec<?>>
    • validateRecipeNameAndDescription

      default void validateRecipeNameAndDescription(org.openrewrite.Recipe recipe)
    • validateRecipeOptions

      default void validateRecipeOptions(org.openrewrite.Recipe recipe)