Added support for a delegating data loader#182
Merged
Conversation
There was a problem hiding this comment.
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
dondonz
approved these changes
Apr 1, 2025
andimarek
approved these changes
Apr 2, 2025
…va/java-dataloader into delegating-dataloader-support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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