refactor test to scalatest