-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
import lombok.experimental.UtilityClass; | ||
|
||
@UtilityClass | ||
public class ITestUtil { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
No description provided.