-
Notifications
You must be signed in to change notification settings - Fork 93
Added support for a delegating data loader #182
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
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.
Pull Request Overview
This PR introduces support for a delegating DataLoader, making it easier to wrap and extend DataLoader behavior while ensuring that all existing and future tests run with delegation in place. Key changes include:
- Adding an unwrap method to the TestDataLoaderFactory interface.
- Introducing a new DelegatingDataLoaderFactory class along with parameterized tests using delegated factories.
- Implementing a DelegatingDataLoader and updating tests and core DataLoader methods to use the unwrap functionality.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/test/java/org/dataloader/fixtures/parameterized/TestDataLoaderFactory.java | Added unwrap() method to support loader delegation |
src/test/java/org/dataloader/fixtures/parameterized/TestDataLoaderFactories.java | Extended tests to run via delegating DataLoader factories |
src/test/java/org/dataloader/fixtures/parameterized/DelegatingDataLoaderFactory.java | New class implementing a delegating DataLoader factory |
src/test/java/org/dataloader/DelegatingDataLoaderTest.java | Added tests to verify unwrapping and delegation behavior |
src/test/java/org/dataloader/DataLoaderTest.java | Updated type-check conditions to use unwrap() |
src/main/java/org/dataloader/DelegatingDataLoader.java | Introduced a delegating wrapper for DataLoader |
src/main/java/org/dataloader/DataLoader.java | Added parameter annotations and a null check in load() |
Comments suppressed due to low confidence (1)
src/test/java/org/dataloader/fixtures/parameterized/DelegatingDataLoaderFactory.java:13
- [nitpick] Consider rephrasing this comment for clarity and professionalism, e.g., 'It delegates to the underlying DataLoader instance.'
// its delegates all the way down to the turtles
…va/java-dataloader into delegating-dataloader-support
This allows you to more easily wrap a DataLoader.
This uses the wonderful parameterised test factories and hence ALL the current (and future) data loader tests will run with the delegation in place.
This REALLY REALLY proves the delegation works and will continue to work for new tests