Skip to content

Commit 8a64483

Browse files
committed
Making the Subscribers use a common base class- now with failing test case
1 parent 4396624 commit 8a64483

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/test/java/org/dataloader/DataLoaderBatchPublisherTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,20 @@ public void should_Resolve_to_error_to_indicate_failure() throws ExecutionExcept
385385
DataLoader<Integer, Object> evenLoader = idLoaderOddEvenExceptions(new DataLoaderOptions(), loadCalls);
386386

387387
CompletableFuture<Object> future1 = evenLoader.load(1);
388-
evenLoader.dispatch();
388+
CompletableFuture<List<Object>> dispatchCF = evenLoader.dispatch();
389389

390390
await().until(future1::isDone);
391391
assertThat(future1.isCompletedExceptionally(), is(true));
392392
assertThat(cause(future1), instanceOf(IllegalStateException.class));
393+
assertThat(dispatchCF.isCompletedExceptionally(), is(true));
393394

394395
CompletableFuture<Object> future2 = evenLoader.load(2);
395-
evenLoader.dispatch();
396+
dispatchCF = evenLoader.dispatch();
396397

397398
await().until(future2::isDone);
398399
assertThat(future2.get(), equalTo(2));
399400
assertThat(loadCalls, equalTo(asList(singletonList(1), singletonList(2))));
401+
assertThat(dispatchCF.isCompletedExceptionally(), is(true));
400402
}
401403

402404
// Accept any kind of key.

src/test/java/org/dataloader/DataLoaderMappedBatchPublisherTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void should_Propagate_error_to_all_loads() {
116116

117117
CompletableFuture<Integer> future1 = errorLoader.load(1);
118118
CompletableFuture<Integer> future2 = errorLoader.load(2);
119-
errorLoader.dispatch();
119+
CompletableFuture<List<Integer>> dispatchedCF = errorLoader.dispatch();
120120

121121
await().until(future1::isDone);
122122

@@ -132,6 +132,8 @@ public void should_Propagate_error_to_all_loads() {
132132
assertThat(cause.getMessage(), equalTo(cause.getMessage()));
133133

134134
assertThat(loadCalls, equalTo(singletonList(asList(1, 2))));
135+
136+
assertThat(dispatchedCF.isCompletedExceptionally(),equalTo(true));
135137
}
136138

137139
@Test

0 commit comments

Comments
 (0)