Liftwizard includes utilities for asserting that a string equals the contents of a file. If your code has changed enough, it can be more convenient to re-record the test resource files, and review the changes using rather than the test assertion errors. To enable re-record mode, set the environment variable to . The setup is different for the JUnit 4 Rule and JUnit 5 Extension. After setup, both have the same API. If the file does not exist, or the contents do not match, an assertion error is added to an ErrorCollector. If the ErrorCollector contains any errors, the test fails at the end with all expected/actual pairs reported together. If is set to , will not emit any . JUnit 4 public class ExampleTest { @Rule public final FileMatchRule fileMatchRule = new FileMatchRule(this.getClass()); @Test public void smokeTest() { String resourceClassPathLocation = this.getClass().getSimpleName() + ".txt"; this.fileMatchRule.assertFileContents(resourceClassPathLocation, "test content"); } } JUnit 5 public class ExampleTest { @RegisterExtension private final FileMatchExtension fileMatchExtension = new FileMatchExtension(this.getClass()); @Test public void smokeTest() { String resourceClassPathLocation = this.getClass().getSimpleName() + ".txt"; this.fileMatchExtension.assertFileContents(resourceClassPathLocation, "test content"); } } git diff LIFTWIZARD_FILE_MATCH_RULE_RERECORD true this.fileMatchExtension.assertFileContents(expectedStringClassPathLocation, actualString); LIFTWIZARD_FILE_MATCH_RULE_RERECORD true assertFileContents AssertionErrors