-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Introduce builder for RealtimeTestEnvironment #6043
Introduce builder for RealtimeTestEnvironment #6043
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6043 +/- ##
==========================================
Coverage 69.78% 69.78%
Complexity 17356 17356
==========================================
Files 1962 1962
Lines 74359 74359
Branches 7624 7624
==========================================
+ Hits 51892 51893 +1
+ Misses 19823 19821 -2
- Partials 2644 2645 +1 ☔ View full report in Codecov by Sentry. |
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.
Nice with a builder for the environments!
...java/org/opentripplanner/updater/trip/moduletests/cancellation/CancellationDeletionTest.java
Outdated
Show resolved
Hide resolved
...java/org/opentripplanner/updater/trip/moduletests/cancellation/CancellationDeletionTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opentripplanner/updater/trip/moduletests/delay/DelayedTest.java
Outdated
Show resolved
Hide resolved
|
||
var tripId = env.trip2.getId().getId(); | ||
var tripId = TRIP_2_ID; |
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.
We can probably get rid of this tripId
variable now that it doesn't reallly improve readability anymore
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.
I reworked the handling of the IDs here: c97d90a
src/test/java/org/opentripplanner/updater/trip/moduletests/delay/SkippedTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opentripplanner/updater/trip/moduletests/delay/SkippedTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Henrik Abrahamsson <[email protected]>
I have now extracted builders not only for the environment but also for the trips that are in it. |
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 looks very good to me. Just a comment on a name
src/test/java/org/opentripplanner/updater/trip/RealtimeTripInput.java
Outdated
Show resolved
Hide resolved
I've now requested @jtorin to review this. |
Summary
In a previous PR we said that we want to be able to configure the
RealtimeTestEnvironment
instances and only add those trips that we need. This PR refactors the environment and adds a builder that allows you do to exactly.This is made possible by extracting all constants into a separate class that is used throughout the test code.
Issue
#4816
Unit tests
This is just tests.