also fix FlowInterleaveSpec
Also-by: Johan Andrén <johan@markatta.com> Also-by: Roland Kuhn <rk@rkuhn.info> Also-by: Martynas Mickevičius <mmartynas@gmail.com>
This commit is contained in:
parent
ef77b56e66
commit
60497f6561
195 changed files with 1110 additions and 857 deletions
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
package akka.http.scaladsl.testkit
|
||||
|
||||
import akka.NotUsed
|
||||
|
||||
import scala.concurrent.duration._
|
||||
|
||||
import akka.util.ByteString
|
||||
|
|
@ -24,7 +26,7 @@ import akka.http.scaladsl.model.ws.{ BinaryMessage, TextMessage, Message }
|
|||
* Requesting elements is handled automatically.
|
||||
*/
|
||||
trait WSProbe {
|
||||
def flow: Flow[Message, Message, Unit]
|
||||
def flow: Flow[Message, Message, NotUsed]
|
||||
|
||||
/**
|
||||
* Send the given messages out of the flow.
|
||||
|
|
@ -96,6 +98,7 @@ trait WSProbe {
|
|||
object WSProbe {
|
||||
/**
|
||||
* Creates a WSProbe to use in tests against websocket handlers.
|
||||
*
|
||||
* @param maxChunks The maximum number of chunks to collect for streamed messages.
|
||||
* @param maxChunkCollectionMills The maximum time in milliseconds to collect chunks for streamed messages.
|
||||
*/
|
||||
|
|
@ -104,7 +107,7 @@ object WSProbe {
|
|||
val subscriber = TestSubscriber.probe[Message]()
|
||||
val publisher = TestPublisher.probe[Message]()
|
||||
|
||||
def flow: Flow[Message, Message, Unit] = Flow.fromSinkAndSourceMat(Sink.fromSubscriber(subscriber), Source.fromPublisher(publisher))(Keep.none)
|
||||
def flow: Flow[Message, Message, NotUsed] = Flow.fromSinkAndSourceMat(Sink.fromSubscriber(subscriber), Source.fromPublisher(publisher))(Keep.none)
|
||||
|
||||
def sendMessage(message: Message): Unit = publisher.sendNext(message)
|
||||
def sendMessage(text: String): Unit = sendMessage(TextMessage(text))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue