mdedetrich commented on code in PR #1060: URL: https://github.com/apache/pekko-connectors/pull/1060#discussion_r2073264368
########## google-common/src/test/scala/org/apache/pekko/stream/connectors/google/util/AnnotateLastSpec.scala: ########## @@ -33,22 +33,23 @@ class AnnotateLastSpec "AnnotateLast" should { "indicate last element" in { - val probe = Source(1 to 3).via(AnnotateLast[Int]).runWith(TestSink.probe) + val probe = Source(1 to 3).via(AnnotateLast[Int](0)).runWith(TestSink.probe) probe.requestNext(NotLast(1)) probe.requestNext(NotLast(2)) probe.requestNext(Last(3)) probe.expectComplete() } "indicate first element is last if only one element" in { - val probe = Source.single(1).via(AnnotateLast[Int]).runWith(TestSink.probe) + val probe = Source.single(1).via(AnnotateLast[Int](0)).runWith(TestSink.probe) probe.requestNext(Last(1)) probe.expectComplete() } - "do nothing when stream is empty" in { - val probe = Source.empty[Nothing].via(AnnotateLast[Nothing]).runWith(TestSink.probe) - probe.expectSubscriptionAndComplete() + "return zero value when stream is empty" in { Review Comment: Note that while this PR does change the behaviour of `AnnotateLast`, this doesn't appear to be used outside of the context of `ResumableUpload` in gcs. If requested, it is possible to provide 2 versions of `AnnotateLast.apply`, one that emits the sentinel value in case of the empty stream and another that doesn't emit anything on empty stream (old behaviour). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org