pekko/akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceFromPublisherSpec.scala

29 lines
846 B
Scala
Raw Normal View History

/*
2022-02-04 12:36:44 +01:00
* Copyright (C) 2021-2022 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.stream.scaladsl
2022-04-08 17:05:13 +08:00
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpecLike
import akka.actor.ActorSystem
import akka.stream.Attributes
import akka.stream.testkit.TestPublisher
import akka.testkit.TestKit
class SourceFromPublisherSpec
extends TestKit(ActorSystem("source-from-publisher-spec"))
with AsyncWordSpecLike
with Matchers {
"Source.fromPublisher" should {
// https://github.com/akka/akka/pull/31129
"consider 'inputBuffer' attributes in a correct way" in pendingUntilFixed {
val publisher = TestPublisher.probe[Int]()
Source.fromPublisher(publisher).addAttributes(Attributes.inputBuffer(1, 2)).runWith(Sink.ignore)
publisher.expectRequest() should ===(2L)
}
}
}