=str #18501 make TestSink.probe consistent in style with Sink.head

Also known as, we do not use () for those
This commit is contained in:
Konrad Malawski 2015-09-17 13:10:09 +02:00
parent ab96ebfca0
commit dcfbaed206
9 changed files with 41 additions and 38 deletions

View file

@ -172,7 +172,7 @@ class SynchronousFileSourceSpec extends AkkaSpec(UnboundedMailboxConfig) {
implicit val timeout = Timeout(500.millis)
try {
val p = SynchronousFileSource(manyLines).runWith(TestSink.probe())(mat)
val p = SynchronousFileSource(manyLines).runWith(TestSink.probe)(mat)
mat.asInstanceOf[ActorMaterializerImpl].supervisor.tell(StreamSupervisor.GetChildren, testActor)
val ref = expectMsgType[Children].children.find(_.path.toString contains "File").get
@ -188,7 +188,7 @@ class SynchronousFileSourceSpec extends AkkaSpec(UnboundedMailboxConfig) {
try {
val p = SynchronousFileSource(manyLines)
.withAttributes(ActorAttributes.dispatcher("akka.actor.default-dispatcher"))
.runWith(TestSink.probe())(mat)
.runWith(TestSink.probe)(mat)
mat.asInstanceOf[ActorMaterializerImpl].supervisor.tell(StreamSupervisor.GetChildren, testActor)
val ref = expectMsgType[Children].children.find(_.path.toString contains "File").get

View file

@ -4,14 +4,14 @@
package akka.stream.scaladsl
import akka.stream.testkit.scaladsl.TestSink
import akka.stream.{ActorAttributes, ActorMaterializer, ActorMaterializerSettings, Supervision}
import akka.stream.{ ActorAttributes, ActorMaterializer, ActorMaterializerSettings, Supervision }
import akka.stream.testkit.AkkaSpec
import akka.stream.testkit.Utils._
import scala.collection.immutable
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.concurrent.forkjoin.ThreadLocalRandom.{current => random}
import scala.concurrent.forkjoin.ThreadLocalRandom.{ current random }
class FlowScanSpec extends AkkaSpec {
@ -41,8 +41,8 @@ class FlowScanSpec extends AkkaSpec {
}
"emit values promptly" in {
Source.single(1).concat(Source.lazyEmpty).scan(0)(_ + _).grouped(2).runWith(TestSink.probe())
.toStrict(1.second) should ===(Seq(0, 1))
val f = Source.single(1).concat(Source.lazyEmpty).scan(0)(_ + _).grouped(2).runWith(Sink.head)
Await.result(f, 1.second) should ===(Seq(0, 1))
}
"fail properly" in {
@ -51,7 +51,7 @@ class FlowScanSpec extends AkkaSpec {
require(current > 0)
old + current
}.withAttributes(supervisionStrategy(Supervision.restartingDecider))
Source(List(1, 3, -1, 5, 7)).via(scan).runWith(TestSink.probe())
Source(List(1, 3, -1, 5, 7)).via(scan).runWith(TestSink.probe)
.toStrict(1.second) should ===(Seq(0, 1, 4, 0, 5, 12))
}
}

View file

@ -300,7 +300,7 @@ class FlowStageSpec extends AkkaSpec(ConfigFactory.parseString("akka.actor.debug
emit(Iterator(elem, elem), ctx)
}
})
.runWith(TestSink.probe[Int]())
.runWith(TestSink.probe[Int])
.request(1000)
.expectNext(1)
.cancel()
@ -444,7 +444,7 @@ class FlowStageSpec extends AkkaSpec(ConfigFactory.parseString("akka.actor.debug
terminationEmit(Iterator("byebye"), ctx)
}
})
.runWith(TestSink.probe[String]())
.runWith(TestSink.probe[String])
.request(1)
.expectNext("hi1")
.request(2)