I wrote a simple test for my CipherStage and it appears to work fine:
"CipherStage" should "work" in {
val clearText = "0123456789abcdef"
val clearSource = Source.single(ByteString(clearText))
val encodedKey: String = "KCl02Tjzsid09VnDl6CDpDlnm4G4VUJr8l6PNg+MHkQ="
val decodedKey = Base64.
I wrote a simple test case using a graph rather than using src.runForEach.
"CipherStage in graph" should "work" in {
val clearText = "0123456789abcdef"
val clearSource = Source.single(ByteString(clearText))
val encryptedOut = Sink.head[ByteString]
val encodedKey: String = "KCl02Tjzsid0
I found my (stupid) problem. I had used:
val encryptedOut = Sink.head[ByteString]
instead of:
val encryptedOut: Sink[ByteString, Future[ByteString]] = Sink.fold[ByteString,
ByteString](ByteString())(_ ++ _)
Consequently, only the first chunk of the stream was being kept. I’m not
entirely sure
Can you post a minimal reproducer?
On Fri, Oct 7, 2016 at 9:02 PM, Eric Swenson wrote:
> I wrote a simple test for my CipherStage and it appears to work fine:
>
> "CipherStage" should "work" in {
> val clearText = "0123456789abcdef"
> val clearSource = Source.single(ByteString(clearText))
>