Here is my endpoint in akka-http:
private val route = Route.asyncHandler(
pathPrefix("v0") {
headerValueByType[JWTTokenObject](()) { jwtHeader =>
mapRequest(authorize(jwtHeader.value)) {
authenticateOrRejectWithChallenge(authenticate(transactionId, _)) { claims =>
pathPrefix("v1"/Segment) { someValue =>
path("v3") {
post {
handleThisPostRequest(someValue)
}
}
}
}
}
}
)
This is one of the POST API which authenticates using JWT 'Bearer' token which is passed as a header value. I want to test this End To End. It is also calling DBs and third party services.
I am trying to add any API test framework so that I will be able to test this on any environments. Can you suggest any framework to achieve this type of integration tests where enviroment variables are involved in calling third party APIs.
Is it possible to test this using spray-testkit(Test API REST SCALA)? An example will be helpful. Thanks