+htk add RouteTest.testAppRoute
This commit is contained in:
parent
4c24b72b31
commit
4fe85b8b56
2 changed files with 7 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ import scala.concurrent.duration._
|
|||
import akka.stream.ActorMaterializer
|
||||
import akka.http.scaladsl.server
|
||||
import akka.http.javadsl.model.HttpRequest
|
||||
import akka.http.javadsl.server.{ AllDirectives, Route, Directives }
|
||||
import akka.http.javadsl.server.{ HttpApp, AllDirectives, Route, Directives }
|
||||
import akka.http.impl.util.JavaMapping.Implicits._
|
||||
import akka.http.impl.server.RouteImplementation
|
||||
import akka.http.scaladsl.model.HttpResponse
|
||||
|
|
@ -50,5 +50,10 @@ abstract class RouteTest extends AllDirectives {
|
|||
def run(request: HttpRequest): TestResponse = runRoute(underlying, request)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a [[TestRoute]] for the main route of an [[HttpApp]].
|
||||
*/
|
||||
def testAppRoute(app: HttpApp): TestRoute = testRoute(app.createRoute)
|
||||
|
||||
protected def createTestResponse(response: HttpResponse): TestResponse
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue