Skip to content

Commit

Permalink
Stream Testkit: use assertAllStagesStopped with system in the Java DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru committed Nov 13, 2020
1 parent 24d01a1 commit 32e8907
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

package akka.stream.testkit.javadsl

import akka.stream.Materializer
import akka.actor.ClassicActorSystemProvider
import akka.stream.{ Materializer, SystemMaterializer }
import akka.stream.impl.PhasedFusingActorMaterializer
import akka.stream.testkit.scaladsl

Expand All @@ -21,4 +22,13 @@ object StreamTestKit {
scaladsl.StreamTestKit.assertNoChildren(impl.system, impl.supervisor)
case _ =>
}

/**
* Assert that there are no stages running under a given system's materializer.
* Usually this assertion is run after a test-case to check that all of the
* stages have terminated successfully.
*/
def assertAllStagesStopped(system: ClassicActorSystemProvider): Unit = {
assertAllStagesStopped(SystemMaterializer(system).materializer)
}
}

0 comments on commit 32e8907

Please sign in to comment.