This sounds a bit weird... I don't think those changed that much in the move to 
2.0.
Could you make the problem example a gist (gist.github.com or complete snippet 
in email, ready to copy/paste) I could downlaod and quickly have a look? Thanks 
in advance!

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Typesafe

On 23 December 2015 at 22:44:47, Dennis Vriend (dnvri...@gmail.com) wrote:

Hi, I have a question about akka stream. I want to migrate a project from akka 
2.3 to 2.4.1 and akka stream 1.0 to 2.0.1 and I must now refactor tests. In the 
test an akka stream is used with the fluent like DSL in which one can expect 
messages. , an assertion error will be thrown "`remaining` may not be called 
outside of `within`"

The only way I can fix this is to refactor the test so that the TestSubscriber 
will be closed over by the .within(FiniteDuration) method, in which the curried 
function can do the assertion. This is different from the 1.0 version of 
akka-stream.



Is this the correct way to use the TestSubscriber from now on or am I missing 
something?

Note: this would break the fluent chain like DSL from akka stream 1.0 in a big 
way, which would be a shame.



Example from the 1.0 syntax:



currentPersistenceIds(readJournal)

.request(2)

.expectNextUnOrdered("a", "b")

.expectComplete()



Using the code above will give the assertion error on akka stream 2.0.



To make it work the code must be:



val xx = currentPersistenceIds(readJournal)

.request(2)



xx.within(10.seconds) {

  xx.expectNextUnOrdered("a", "b")

  .expectComplete()

}



I am sure I am doing something wrong, can someone help me out?



Thanks!



Dennis





--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to