Skip to content

Commit

Permalink
Fix LazyZipTest.
Browse files Browse the repository at this point in the history
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
  • Loading branch information
yufei-cai committed Nov 9, 2021
1 parent f8fe0bb commit 4217645
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
*/
package org.eclipse.ditto.internal.utils.akka.controlflow;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.After;
import org.junit.Test;

import akka.NotUsed;
import akka.actor.ActorSystem;
import akka.japi.Pair;
import akka.stream.Attributes;
import akka.stream.FanInShape2;
import akka.stream.Graph;
import akka.stream.SourceShape;
Expand Down Expand Up @@ -73,6 +70,8 @@ public void shutdown() {
TestKit.shutdownActorSystem(actorSystem);
}

// Not possible to test lazy request due to async boundaries with input buffers around test probes.

@Test
public void eagerCancel() {
sink.cancel();
Expand All @@ -95,8 +94,10 @@ public void eagerComplete2() {
}

@Test
public void request() {
sink.request(2);
assertThat(source1.expectRequest()).isEqualTo(1L);
public void error1() {
final var error = new IllegalStateException("Expected");
source1.sendError(error);
source2.expectCancellation();
sink.expectError(error);
}
}

0 comments on commit 4217645

Please sign in to comment.