Interface CodemodTestMixin


public interface CodemodTestMixin
The basic tests for codemods.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Stream<org.junit.jupiter.api.DynamicTest>
     
    default void
    verifyTransformedCode(Path before, Path expected, Path after)
    A hook for verifying the before and after files.
  • Method Details

    • generateTestCases

      @TestFactory default Stream<org.junit.jupiter.api.DynamicTest> generateTestCases(@TempDir Path tmpDir) throws IOException
      Throws:
      IOException
    • verifyTransformedCode

      default void verifyTransformedCode(Path before, Path expected, Path after) throws IOException
      A hook for verifying the before and after files. By default, this method will compare the contents of the two files for exact equality.
      Parameters:
      before - a file containing the contents before transformation
      expected - the file contents that are expected after transformation
      after - a file containing the contents after transformation
      Throws:
      IOException