Skip to content

Outdated AssertFile usage in section "Validating Output Files" of the reference documentation #4754

Closed
@g00glen00b

Description

@g00glen00b

Since the removal of AssertFile in 5.2 (#4181), the docs about "Validating Output Files" are outdated (source).

I suggest either removing it (since it's no longer part of spring-batch-test or rewrite it, for example to something like:

[[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.  Assertion libraries like AssertJ can help you with that by 
asserting that two files have the same content, line by line. 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 File EXPECTED_FILE = new File("src/main/resources/data/input.txt");
private static final File OUTPUT_FILE = new File("target/test-outputs/output.txt");

Assertions.assertThat(EXPECTED_FILE).hasSameTextualContentAs(OUTPUT_FILE);
----

If this altered text is okay, I could turn it into a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions