This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new e695cc9988 chore: Remove stream testkit's prob methods (#2440)
e695cc9988 is described below
commit e695cc998864904918106e0e8d74381eef87a883
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sat Nov 8 18:06:46 2025 +0800
chore: Remove stream testkit's prob methods (#2440)
---
docs/src/test/scala/docs/stream/RateTransformationDocSpec.scala | 8 ++++----
.../2.0.x.backwards.excludes/remove-deprecated-methods.excludes | 4 ++++
.../scala/org/apache/pekko/stream/testkit/javadsl/TestSink.scala | 7 -------
.../org/apache/pekko/stream/testkit/javadsl/TestSource.scala | 7 -------
.../scala/org/apache/pekko/stream/testkit/scaladsl/TestSink.scala | 6 ------
.../org/apache/pekko/stream/testkit/scaladsl/TestSource.scala | 6 ------
.../test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala | 2 +-
.../test/scala/org/apache/pekko/stream/scaladsl/SourceSpec.scala | 2 +-
8 files changed, 10 insertions(+), 32 deletions(-)
diff --git a/docs/src/test/scala/docs/stream/RateTransformationDocSpec.scala
b/docs/src/test/scala/docs/stream/RateTransformationDocSpec.scala
index 9436cb3184..2793b784f7 100644
--- a/docs/src/test/scala/docs/stream/RateTransformationDocSpec.scala
+++ b/docs/src/test/scala/docs/stream/RateTransformationDocSpec.scala
@@ -67,7 +67,7 @@ class RateTransformationDocSpec extends PekkoSpec {
val lastFlow = Flow[Double].extrapolate(Iterator.continually(_))
// #extrapolate-last
- val (probe, fut) =
TestSource[Double].via(lastFlow).grouped(10).toMat(Sink.head)(Keep.both).run()
+ val (probe, fut) =
TestSource[Double]().via(lastFlow).grouped(10).toMat(Sink.head)(Keep.both).run()
probe.sendNext(1.0)
val extrapolated = fut.futureValue
@@ -81,7 +81,7 @@ class RateTransformationDocSpec extends PekkoSpec {
val seedFlow = Flow[Double].extrapolate(Iterator.continually(_),
Some(initial))
// #extrapolate-seed
- val fut = TestSource[Double].via(seedFlow).grouped(10).runWith(Sink.head)
+ val fut = TestSource[Double]().via(seedFlow).grouped(10).runWith(Sink.head)
val extrapolated = fut.futureValue
extrapolated.size shouldBe 10
@@ -97,7 +97,7 @@ class RateTransformationDocSpec extends PekkoSpec {
case (d, _) => latch.countDown(); Iterator.from(1).map(d -> _)
}
- val (pub, sub) =
TestSource[Double].via(realDriftFlow).toMat(TestSink[(Double,
Int)]())(Keep.both).run()
+ val (pub, sub) =
TestSource[Double]().via(realDriftFlow).toMat(TestSink[(Double,
Int)]())(Keep.both).run()
sub.request(1)
pub.sendNext(1.0)
@@ -118,7 +118,7 @@ class RateTransformationDocSpec extends PekkoSpec {
val latch = TestLatch(2)
val realDriftFlow = Flow[Double].expand(d => { latch.countDown();
Iterator.from(0).map(d -> _) })
- val (pub, sub) =
TestSource[Double].via(realDriftFlow).toMat(TestSink[(Double,
Int)]())(Keep.both).run()
+ val (pub, sub) =
TestSource[Double]().via(realDriftFlow).toMat(TestSink[(Double,
Int)]())(Keep.both).run()
sub.request(1)
pub.sendNext(1.0)
diff --git
a/stream-testkit/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
b/stream-testkit/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
index 8ade4867d9..5efe565639 100644
---
a/stream-testkit/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
+++
b/stream-testkit/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
@@ -18,3 +18,7 @@
# Remove deprecated methods
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.testkit.TestPublisher#ManualProbe.expectNoMsg")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.testkit.TestSubscriber#ManualProbe.expectNoMsg")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.testkit.javadsl.TestSink.probe")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.testkit.javadsl.TestSource.probe")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.testkit.scaladsl.TestSink.probe")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.testkit.scaladsl.TestSource.probe")
diff --git
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSink.scala
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSink.scala
index 98dec58882..d6ab2db74c 100644
---
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSink.scala
+++
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSink.scala
@@ -14,7 +14,6 @@
package org.apache.pekko.stream.testkit.javadsl
import org.apache.pekko
-import pekko.actor.ActorSystem
import pekko.actor.ClassicActorSystemProvider
import pekko.stream.javadsl.Sink
import pekko.stream.testkit._
@@ -22,12 +21,6 @@ import pekko.stream.testkit._
/** Java API */
object TestSink {
- /**
- * A Sink that materialized to a [[pekko.stream.testkit.TestSubscriber]].
- */
- @deprecated("Use `TestSink.create` with ClassicActorSystemProvider instead
of ActorSystem", "1.3.0")
- def probe[T](system: ActorSystem): Sink[T, TestSubscriber.Probe[T]] =
create(system)
-
/**
* A Sink that materialized to a [[pekko.stream.testkit.TestSubscriber]].
*/
diff --git
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSource.scala
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSource.scala
index 42c151abc7..968c3f3e49 100644
---
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSource.scala
+++
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/javadsl/TestSource.scala
@@ -14,7 +14,6 @@
package org.apache.pekko.stream.testkit.javadsl
import org.apache.pekko
-import pekko.actor.ActorSystem
import pekko.actor.ClassicActorSystemProvider
import pekko.stream.javadsl.Source
import pekko.stream.testkit._
@@ -22,12 +21,6 @@ import pekko.stream.testkit._
/** Java API */
object TestSource {
- /**
- * A Source that materializes to a [[pekko.stream.testkit.TestPublisher]].
- */
- @deprecated("Use `TestSource.create` with ClassicActorSystemProvider instead
of ActorSystem", "1.3.0")
- def probe[T](system: ActorSystem): Source[T, TestPublisher.Probe[T]] =
create(system)
-
/**
* A Source that materializes to a [[pekko.stream.testkit.TestPublisher]].
*/
diff --git
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSink.scala
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSink.scala
index 0ddd14d444..9e38a0d183 100644
---
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSink.scala
+++
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSink.scala
@@ -28,12 +28,6 @@ import pekko.stream.testkit.TestSubscriber.Probe
*/
object TestSink {
- /**
- * A Sink that materialized to a [[pekko.stream.testkit.TestSubscriber]].
- */
- @deprecated("Use `TestSink.apply` with implicit ClassicActorSystemProvider
instead of ActorSystem", "1.3.0")
- def probe[T](implicit system: ActorSystem): Sink[T, Probe[T]] = apply()
-
/**
* A Sink that materialized to a [[pekko.stream.testkit.TestSubscriber]].
*/
diff --git
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSource.scala
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSource.scala
index 2375769a34..371cb53831 100644
---
a/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSource.scala
+++
b/stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/scaladsl/TestSource.scala
@@ -27,12 +27,6 @@ import pekko.stream.testkit.StreamTestKit.ProbeSource
*/
object TestSource {
- /**
- * A Source that materializes to a [[pekko.stream.testkit.TestPublisher]].
- */
- @deprecated("Use `TestSource.apply` with implicit ClassicActorSystemProvider
instead of ActorSystem", "1.3.0")
- def probe[T](implicit system: ActorSystem): Source[T,
TestPublisher.Probe[T]] = apply()
-
/**
* A Source that materializes to a [[pekko.stream.testkit.TestPublisher]].
*/
diff --git
a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala
b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala
index 86f54f4f05..064bd0cdb5 100644
---
a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala
+++
b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowSpec.scala
@@ -559,7 +559,7 @@ class FlowSpec extends
StreamSpec(ConfigFactory.parseString("pekko.actor.debug.r
flow,
Flow.fromFunction { (string: String) => string.toInt }
)(Keep.none)
- ).runWith(TestSink[Option[Int]])
+ ).runWith(TestSink[Option[Int]]())
.request(4)
.expectNext(Some(1), None, None, Some(4))
.expectComplete()
diff --git
a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceSpec.scala
b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceSpec.scala
index af1fa7016d..780760f6a7 100644
---
a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceSpec.scala
+++
b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceSpec.scala
@@ -464,7 +464,7 @@ class SourceSpec extends StreamSpec with DefaultTimeout {
Source(data),
Flow.fromFunction { (string: String) => string.toInt }
)(Keep.none)
- .runWith(TestSink[Option[Int]])
+ .runWith(TestSink[Option[Int]]())
.request(4)
.expectNext(Some(1), None, None, Some(4))
.expectComplete()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]