jeudi 22 février 2018

How to write the integration test cases in Akka-HTTP services using sbt-scoverage?

Can anyone suggest how can I write the integration tests in Akka-HTTP services using sbt-scoverage. I have written unit test cases now I need to implement integration tests.

This is my route

val routes = {
    logRequestResult("microservice") {
      path("test") {
        (post) {
          complete {
            find().map { v => 
              var info = convertToJson(v) 
              HttpResponse(entity = HttpEntity(ContentType(MediaTypes.`application/json`), info.getOrElse(Json.obj()).toString))
            }
          }
        }
      }
    }
  }

and my model class method is

    def find()(implicit ec: ExecutionContext): Future[Option[Details]] = {
  collection.find(BSONDocument()).one[Details]

}

can u suggest how to write integration tests for above route

Aucun commentaire:

Enregistrer un commentaire