From 2b1b5d1c9d0dbd682154c40ee2215d604585cc2f Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Wed, 19 Mar 2025 08:20:39 +0100 Subject: [PATCH] Remove outdated usage of AssertFile in documentation Resolves #4754 --- .../modules/ROOT/pages/testing.adoc | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/spring-batch-docs/modules/ROOT/pages/testing.adoc b/spring-batch-docs/modules/ROOT/pages/testing.adoc index 3066d034a..7030be500 100644 --- a/spring-batch-docs/modules/ROOT/pages/testing.adoc +++ b/spring-batch-docs/modules/ROOT/pages/testing.adoc @@ -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