Remove outdated usage of AssertFile in documentation

Resolves #4754
This commit is contained in:
Mahmoud Ben Hassine
2025-03-19 08:20:39 +01:00
parent f9108ee56f
commit 2b1b5d1c9d

View File

@@ -274,26 +274,6 @@ int count = StepScopeTestUtils.doInStepScope(stepExecution,
});
----
[[validatingOutputFiles]]
== Validating Output Files
When a batch job writes to the database, it is easy to query the database to verify that
the output is as expected. However, if the batch job writes to a file, it is equally
important that the output be verified. Spring Batch provides a class called `AssertFile`
to facilitate the verification of output files. The method called `assertFileEquals` takes
two `File` objects (or two `Resource` objects) and asserts, line by line, that the two
files have the same content. Therefore, it is possible to create a file with the expected
output and to compare it to the actual result, as the following example shows:
[source, java]
----
private static final String EXPECTED_FILE = "src/main/resources/data/input.txt";
private static final String OUTPUT_FILE = "target/test-outputs/output.txt";
AssertFile.assertFileEquals(new FileSystemResource(EXPECTED_FILE),
new FileSystemResource(OUTPUT_FILE));
----
[[mockingDomainObjects]]
== Mocking Domain Objects