我是尝试创建自己的测试类还是尝试运行现有的Specs2测试类,都会收到错误java.lang.Exception: Could not instantiate class AliveTestSpec: null
通常,经过一些重建和删除目标文件夹后,我可以将其删除。但是大多数时候我不得不多次。我认为这与缓存有关?但是我不确定。下面是测试类,仅供参考。
class AliveTestSpec extends Specification with Specs2RouteTest with AppConfig with Alive {
sequential
def actorRefFactory = system
def context: akka.actor.ActorRefFactory = system
"AliveTestSpec" should {
"When aliveResponse is invoked, the status is OK" in {
Get("/alive") ~> aliveResponse ~> check {
status === OK
}
}
}
}