Skip to content

Commit 2cdba8a

Browse files
committed
Merge remote-tracking branch 'origin/master' into reactive-streams-branch
# Conflicts: # build.gradle
2 parents 95540ff + a5485c9 commit 2cdba8a

File tree

5 files changed

+24
-19
lines changed

5 files changed

+24
-19
lines changed

.github/workflows/master.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v1
1717
- uses: gradle/wrapper-validation-action@v1
18-
- name: Set up JDK 1.8
18+
- name: Set up JDK 11
1919
uses: actions/setup-java@v1
2020
with:
21-
java-version: '8.0.282'
21+
java-version: '11.0.23'
2222
- name: build test and publish
2323
run: ./gradlew assemble && ./gradlew check --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace

.github/workflows/pull_request.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v1
1515
- uses: gradle/wrapper-validation-action@v1
16-
- name: Set up JDK 1.8
16+
- name: Set up JDK 11
1717
uses: actions/setup-java@v1
1818
with:
19-
java-version: '8.0.282'
19+
java-version: '11.0.23'
2020
- name: build and test
2121
run: ./gradlew assemble && ./gradlew check --info --stacktrace

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v1
2121
- uses: gradle/wrapper-validation-action@v1
22-
- name: Set up JDK 1.8
22+
- name: Set up JDK 11
2323
uses: actions/setup-java@v1
2424
with:
25-
java-version: '8.0.282'
25+
java-version: '11.0.23'
2626
- name: build test and publish
2727
run: ./gradlew assemble && ./gradlew check --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace

build.gradle

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ plugins {
55
id 'java-library'
66
id 'maven-publish'
77
id 'signing'
8-
id "biz.aQute.bnd.builder" version "6.2.0"
8+
id "biz.aQute.bnd.builder" version "6.2.0"
99
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
1010
}
1111

12+
java {
13+
toolchain {
14+
languageVersion = JavaLanguageVersion.of(11)
15+
}
16+
}
1217

1318
def getDevelopmentVersion() {
1419
def output = new StringBuilder()
@@ -38,7 +43,7 @@ targetCompatibility = 1.8
3843
def releaseVersion = System.env.RELEASE_VERSION
3944
version = releaseVersion ? releaseVersion : getDevelopmentVersion()
4045
group = 'com.graphql-java'
41-
description = 'A pure Java 8 port of Facebook Dataloader'
46+
description = 'A pure Java 11 port of Facebook Dataloader'
4247

4348
gradle.buildFinished { buildResult ->
4449
println "*******************************"
@@ -123,7 +128,7 @@ publishing {
123128
asNode().children().last() + {
124129
resolveStrategy = Closure.DELEGATE_FIRST
125130
name 'java-dataloader'
126-
description 'A pure Java 8 port of Facebook Dataloader'
131+
description 'A pure Java 11 port of Facebook Dataloader'
127132
url 'https://github.com/graphql-java/java-dataloader'
128133
inceptionYear '2017'
129134

src/test/java/org/dataloader/DataLoaderTest.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,13 @@ public void should_work_with_duplicate_keys_when_caching_enabled() throws Execut
692692
public void should_Accept_objects_with_a_complex_key() throws ExecutionException, InterruptedException {
693693
List<Collection<JsonObject>> loadCalls = new ArrayList<>();
694694
DataLoaderOptions options = newOptions().setCacheKeyFunction(getJsonObjectCacheMapFn());
695-
DataLoader<JsonObject, Integer> identityLoader = idLoader(options, loadCalls);
695+
DataLoader<JsonObject, JsonObject> identityLoader = idLoader(options, loadCalls);
696696

697697
JsonObject key1 = new JsonObject().put("id", 123);
698698
JsonObject key2 = new JsonObject().put("id", 123);
699699

700-
CompletableFuture<Integer> future1 = identityLoader.load(key1);
701-
CompletableFuture<Integer> future2 = identityLoader.load(key2);
700+
CompletableFuture<JsonObject> future1 = identityLoader.load(key1);
701+
CompletableFuture<JsonObject> future2 = identityLoader.load(key2);
702702
identityLoader.dispatch();
703703

704704
await().until(() -> future1.isDone() && future2.isDone());
@@ -713,18 +713,18 @@ public void should_Accept_objects_with_a_complex_key() throws ExecutionException
713713
public void should_Clear_objects_with_complex_key() throws ExecutionException, InterruptedException {
714714
List<Collection<JsonObject>> loadCalls = new ArrayList<>();
715715
DataLoaderOptions options = newOptions().setCacheKeyFunction(getJsonObjectCacheMapFn());
716-
DataLoader<JsonObject, Integer> identityLoader = idLoader(options, loadCalls);
716+
DataLoader<JsonObject, JsonObject> identityLoader = idLoader(options, loadCalls);
717717

718718
JsonObject key1 = new JsonObject().put("id", 123);
719719
JsonObject key2 = new JsonObject().put("id", 123);
720720

721-
CompletableFuture<Integer> future1 = identityLoader.load(key1);
721+
CompletableFuture<JsonObject> future1 = identityLoader.load(key1);
722722
identityLoader.dispatch();
723723

724724
await().until(future1::isDone);
725725
identityLoader.clear(key2); // clear equivalent object key
726726

727-
CompletableFuture<Integer> future2 = identityLoader.load(key1);
727+
CompletableFuture<JsonObject> future2 = identityLoader.load(key1);
728728
identityLoader.dispatch();
729729

730730
await().until(future2::isDone);
@@ -737,22 +737,22 @@ public void should_Clear_objects_with_complex_key() throws ExecutionException, I
737737
public void should_Accept_objects_with_different_order_of_keys() throws ExecutionException, InterruptedException {
738738
List<Collection<JsonObject>> loadCalls = new ArrayList<>();
739739
DataLoaderOptions options = newOptions().setCacheKeyFunction(getJsonObjectCacheMapFn());
740-
DataLoader<JsonObject, Integer> identityLoader = idLoader(options, loadCalls);
740+
DataLoader<JsonObject, JsonObject> identityLoader = idLoader(options, loadCalls);
741741

742742
JsonObject key1 = new JsonObject().put("a", 123).put("b", 321);
743743
JsonObject key2 = new JsonObject().put("b", 321).put("a", 123);
744744

745745
// Fetches as expected
746746

747-
CompletableFuture<Integer> future1 = identityLoader.load(key1);
748-
CompletableFuture<Integer> future2 = identityLoader.load(key2);
747+
CompletableFuture<JsonObject> future1 = identityLoader.load(key1);
748+
CompletableFuture<JsonObject> future2 = identityLoader.load(key2);
749749
identityLoader.dispatch();
750750

751751
await().until(() -> future1.isDone() && future2.isDone());
752752
assertThat(loadCalls, equalTo(singletonList(singletonList(key1))));
753753
assertThat(loadCalls.size(), equalTo(1));
754754
assertThat(future1.get(), equalTo(key1));
755-
assertThat(future2.get(), equalTo(key1));
755+
assertThat(future2.get(), equalTo(key2));
756756
}
757757

758758
@Test

0 commit comments

Comments
 (0)