Skip to content

Commit

Permalink
feat: Add expectNextN to StreamTestKit.
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Pin committed Jan 15, 2024
1 parent 8760939 commit 50e60be
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ import scala.concurrent.duration._
import scala.reflect.ClassTag

import org.apache.pekko
import pekko.actor.ClassicActorSystemProvider
import org.reactivestreams.{ Publisher, Subscriber, Subscription }
import pekko.actor.{ ActorRef, ActorSystem, DeadLetterSuppression, NoSerializationVerificationNeeded }
import pekko.actor.ClassicActorSystemProvider
import pekko.stream._
import pekko.stream.impl._
import pekko.testkit.{ TestActor, TestProbe }
import pekko.testkit.TestActor.AutoPilot
import pekko.util.JavaDurationConverters
import pekko.util.ccompat._

import org.reactivestreams.{ Publisher, Subscriber, Subscription }

/**
* Provides factory methods for various Publishers.
*/
Expand Down Expand Up @@ -462,6 +463,15 @@ object TestSubscriber {
self
}

/**
* Fluent DSL
* Expect the given elements to be signalled in order.
*/
def expectNextN(elems: java.util.List[I]): Self = {
elems.forEach(e => probe.expectMsg(OnNext(e)))
self
}

/**
* Fluent DSL
* Expect the given elements to be signalled in any order.
Expand Down

0 comments on commit 50e60be

Please sign in to comment.