Remove warnings in akka stream testkit module (#26751)

This commit is contained in:
Christopher Batey 2019-04-16 14:13:21 +01:00 committed by Johan Andrén
parent b26655705a
commit 1820b982bf
15 changed files with 18 additions and 18 deletions

View file

@ -83,6 +83,7 @@ object TestPublisher {
type Self <: ManualProbe[I]
@ccompatUsedUntil213
private val probe: TestProbe = TestProbe()
//this is a way to pause receiving message from probe until subscription is done
@ -419,7 +420,7 @@ object TestSubscriber {
@annotation.tailrec
def expectOneOf(all: immutable.Seq[I]): Unit = all match {
case Nil =>
case list =>
case _ =>
val next = expectNext()
assert(all.contains(next), s"expected one of $all, but received $next")
expectOneOf(all.diff(Seq(next)))
@ -541,8 +542,8 @@ object TestSubscriber {
*/
def expectNextOrError(): Either[Throwable, I] = {
probe.fishForMessage(hint = s"OnNext(_) or error") {
case OnNext(element) => true
case OnError(cause) => true
case OnNext(_) => true
case OnError(_) => true
} match {
case OnNext(n: I @unchecked) => Right(n)
case OnError(err) => Left(err)
@ -568,7 +569,7 @@ object TestSubscriber {
*/
def expectNextOrComplete(): Either[OnComplete.type, I] = {
probe.fishForMessage(hint = s"OnNext(_) or OnComplete") {
case OnNext(n) => true
case OnNext(_) => true
case OnComplete => true
} match {
case OnComplete => Left(OnComplete)

View file

@ -71,7 +71,7 @@ object StreamTestKit {
/** INTERNAL API */
@InternalApi private[testkit] def snapshotString(snapshot: StreamSnapshotImpl): String = {
val builder = StringBuilder.newBuilder
val builder = new StringBuilder()
builder.append(s"activeShells (actor: ${snapshot.self}):\n")
snapshot.activeInterpreters.foreach { shell =>
builder.append(" ")

View file

@ -10,7 +10,7 @@ import org.reactivestreams.Publisher
abstract class TwoStreamsSetup extends BaseTwoStreamsSetup {
abstract class Fixture(b: GraphDSL.Builder[_]) {
abstract class Fixture {
def left: Inlet[Int]
def right: Inlet[Int]
def out: Outlet[Outputs]

View file

@ -14,7 +14,7 @@ class GraphConcatSpec extends TwoStreamsSetup {
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val concat = b.add(Concat[Outputs]())
override def left: Inlet[Outputs] = concat.in(0)

View file

@ -17,7 +17,7 @@ class GraphMergeLatestSpec extends TwoStreamsSetup {
override type Outputs = List[Int]
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val merge = b.add(MergeLatest[Int](2))
override def left: Inlet[Int] = merge.in(0)

View file

@ -15,7 +15,7 @@ class GraphMergePreferredSpec extends TwoStreamsSetup {
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val merge = b.add(MergePreferred[Outputs](1))
override def left: Inlet[Outputs] = merge.preferred

View file

@ -15,7 +15,7 @@ class GraphMergePrioritizedSpec extends TwoStreamsSetup {
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val mergePrioritized = b.add(MergePrioritized[Outputs](Seq(2, 8)))
override def left: Inlet[Outputs] = mergePrioritized.in(0)

View file

@ -14,7 +14,7 @@ class GraphMergeSortedSpec extends TwoStreamsSetup with GeneratorDrivenPropertyC
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val merge = b.add(new MergeSorted[Outputs])
override def left: Inlet[Outputs] = merge.in0

View file

@ -17,7 +17,7 @@ class GraphMergeSpec extends TwoStreamsSetup {
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val merge = b.add(Merge[Outputs](2))
override def left: Inlet[Outputs] = merge.in(0)

View file

@ -17,7 +17,7 @@ class GraphZipLatestWithSpec extends TwoStreamsSetup {
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val zip = b.add(ZipWith((_: Int) + (_: Int)))
override def left: Inlet[Int] = zip.in0
override def right: Inlet[Int] = zip.in1

View file

@ -16,7 +16,7 @@ class GraphZipNSpec extends TwoStreamsSetup {
override type Outputs = immutable.Seq[Int]
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val zipN = b.add(ZipN[Int](2))
override def left: Inlet[Int] = zipN.in(0)

View file

@ -16,7 +16,7 @@ class GraphZipSpec extends TwoStreamsSetup {
override type Outputs = (Int, Int)
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val zip = b.add(Zip[Int, Int]())
override def left: Inlet[Int] = zip.in0

View file

@ -15,7 +15,7 @@ class GraphZipWithNSpec extends TwoStreamsSetup {
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val zip = b.add(ZipWithN((_: immutable.Seq[Int]).sum)(2))
override def left: Inlet[Int] = zip.in(0)
override def right: Inlet[Int] = zip.in(1)

View file

@ -14,7 +14,7 @@ class GraphZipWithSpec extends TwoStreamsSetup {
override type Outputs = Int
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture(b) {
override def fixture(b: GraphDSL.Builder[_]): Fixture = new Fixture {
val zip = b.add(ZipWith((_: Int) + (_: Int)))
override def left: Inlet[Int] = zip.in0
override def right: Inlet[Int] = zip.in1

View file

@ -35,7 +35,6 @@ object AkkaDisciplinePlugin extends AutoPlugin with ScalafixSupport {
"akka-persistence-tck",
"akka-persistence-typed",
"akka-remote",
"akka-stream-testkit",
"akka-stream-tests",
"akka-stream-tests-tck",
"akka-testkit")