From 557204902c622077539c43f20ef538fc8138b6b4 Mon Sep 17 00:00:00 2001 From: "He-Pin(kerr)" Date: Tue, 31 Dec 2024 21:41:13 +0800 Subject: [PATCH] chore: fix failed in StreamConvertersSpec (#1655) (#1656) (cherry picked from commit def84bf0c1338cbcdd65019d68453ea639d15ac3) --- .../pekko/stream/scaladsl/StreamConvertersSpec.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala index 7bff2aa6ccc..baff85e0c9a 100644 --- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala +++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/StreamConvertersSpec.scala @@ -22,6 +22,7 @@ import java.util.stream.BaseStream import java.util.stream.Collector import java.util.stream.Collector.Characteristics import java.util.stream.Collectors +import java.util.{ Spliterator, Spliterators } import scala.concurrent.Await import scala.concurrent.duration._ @@ -111,7 +112,7 @@ class StreamConvertersSpec extends StreamSpec with DefaultTimeout { override def parallel(): EmptyStream = this override def isParallel: Boolean = false - override def spliterator(): util.Spliterator[Unit] = ??? + override def spliterator(): util.Spliterator[Unit] = Spliterators.emptySpliterator() override def onClose(closeHandler: Runnable): EmptyStream = ??? override def iterator(): util.Iterator[Unit] = new util.Iterator[Unit] { @@ -136,7 +137,10 @@ class StreamConvertersSpec extends StreamSpec with DefaultTimeout { override def parallel(): FailingStream = this override def isParallel: Boolean = false - override def spliterator(): util.Spliterator[Unit] = ??? + override def spliterator(): util.Spliterator[Unit] = Spliterators.spliteratorUnknownSize( + iterator(), + Spliterator.NONNULL + ) override def onClose(closeHandler: Runnable): FailingStream = ??? override def iterator(): util.Iterator[Unit] = new util.Iterator[Unit] {