Akka 2.2 の pipeline のテストを書く

PipelinePorts を作ってそこにコマンドやイベントを流し込めば普通に結果が返り値で返ってくるのでテストを書きやすい

val pipelinePort = {
  val ctx = new PipelineContext {}
  PipelineFactory.buildFunctionTriple(ctx, new YourPipelineStage)
}

// パイプラインにコマンドをinject
val (eventsAbove, commandsBelow) = piplinePort.commands(yourCommand)

// パイプラインにイベントをinject
val (eventsAbove, commandsBelow) = piplinePort.events(yourEvent)

see also: