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

Issue #263 : Separate test data from the tests and refactor tests #267

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

souravroy
Copy link
Contributor

No description provided.

Copy link
Collaborator

@kdhrubo kdhrubo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@souravroy souravroy merged commit 722f3ef into master Feb 10, 2024
1 check passed
@souravroy souravroy deleted the feature/263_refactor_integration_tests branch February 10, 2024 21:07
import lombok.experimental.UtilityClass;

@UtilityClass
public class ITestUtil {
Copy link
Collaborator

@thadguidry thadguidry Feb 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is static data (almost module like). And looks like only data for Films, so I'd likely rename this to something like /RequestFilmData.java

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and instead of a path like src/test/java/com/homihq/db2rest/utils/ITestUtil.java perhaps be named and moved to a concise path of src/test/data/RequestFilmData.java

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thadguidry please log an issue. This can be a good first issue :)
I am not sure at this time but JUNIT 5 probably allows loading test data from external sources better than earlier versions.
In that case, test data like this can be sourced from JSON files instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if we are rubbing against the old Maven folder conventions, then we likely don't have our POM setup correctly so that we can have good concise paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thadguidry @kdhrubo The integrations tests were a mess. Extracting test data into an util class was the first step, next we'll take further steps to organise the test data. I thought about having separate test json files and load those files as resources during tests, which'll be the next step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants