Package io.codemodder.testutils
Interface CodemodTestMixin
public interface CodemodTestMixin
The basic tests for codemods.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Stream<org.junit.jupiter.api.DynamicTest>generateTestCases(Path tmpDir) default voidverifyTransformedCode(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
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 transformationexpected- the file contents that are expected after transformationafter- a file containing the contents after transformation- Throws:
IOException
-