Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
g00glen00b opened this issue Jan 30, 2025 · 1 comment

Comments

@g00glen00b
Copy link

g00glen00b commented Jan 30, 2025

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.

@g00glen00b g00glen00b added the status: waiting-for-triage Issues that we did not analyse yet label Jan 30, 2025
@g00glen00b g00glen00b changed the title Remove AssertFile reference in "Validating Output Files" doc Remove AssertFile reference in "Validating Output Files" docs Jan 30, 2025
@fmbenhassine
Copy link
Contributor

Thank you for raising this issue and for opening a PR!

I suggest either removing it (since it's no longer part of spring-batch-test or rewrite it

I would remove it. That section does not have any added value anymore after the removal of the utility class from Spring Batch. The other reason is to avoid showcasing a feature from a specific testing library (one might ask why AssertJ and not other library), which does not have its place in Spring Batch's doc in the first place.

For these reasons, I will remove the section from the docs and close #4779.

@fmbenhassine fmbenhassine changed the title Remove AssertFile reference in "Validating Output Files" docs Outdated AssertFile usage in section "Validating Output Files" of the reference documentation Mar 19, 2025
@fmbenhassine fmbenhassine added in: documentation type: bug and removed status: waiting-for-triage Issues that we did not analyse yet labels Mar 19, 2025
@fmbenhassine fmbenhassine added this to the 5.2.2 milestone Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants