Skip to content

Commit d45186c

Browse files
Parameterise DataLoaderTest on DataLoader
The existing `DataLoaderTest` covers a very large range of test cases which will be very useful to validate what is being added in graphql-java#148. To allow new `*Publisher` `DataLoader`s to leverage this without copy-pasting, we make `DataLoaderTest` a parameterised test, using two `DataLoader` variants: - the stock 'List' `DataLoader`. - the 'Mapped' `DataLoader`. Most of the tests in `DataLoaderTest` have been retrofitted for this parameterisation, resulting in: - deduplicated code (many of the `MappedDataLoader` tests have the same test cases, almost line-for-line). - increased coverage of the `MappedDataLoader`, bolstering confidence in subsequent changes (rather than relying on the author understanding how everything is put together internally).
1 parent 856a2b7 commit d45186c

File tree

3 files changed

+299
-338
lines changed

3 files changed

+299
-338
lines changed

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ dependencies {
7272
testImplementation 'com.github.ben-manes.caffeine:caffeine:2.9.0'
7373
testImplementation platform('org.junit:junit-bom:5.10.2')
7474
testImplementation 'org.junit.jupiter:junit-jupiter-api'
75+
testImplementation 'org.junit.jupiter:junit-jupiter-params'
7576
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
7677
}
7778

src/test/java/org/dataloader/DataLoaderMapBatchLoaderTest.java

-184
This file was deleted.

0 commit comments

Comments
 (0)