I am quite new to akka-http and especially to websockets. I have a service 
which runs on `localhost:8080` and has a path `/greeter`. When a request 
comes on this path then it forwards the request to `/greeter` on 
`localhost:9000` where the handler is of return type 
`Flow[Message,Message,Any]`. I need to unit test the method which is on 
`localhost:8080` where originally the request came. So in unit test we will 
need to use mocking for the response of `localhost:9000` method that 
handles the request. So can anyone suggest how that mocking can be achieved 
as I am unable to figure out the way.

    val http: HttpExt = Http()   

    def webSocketResponse: 
Flow[Message,Message,Future[WebSocketUpgradeResponse]] = 
http.webSocketClientFlow(WebSocketRequest("ws://localhost:9000/greeter"))       


    val sampleRoutes =  path(GREETER) {
                 
                 val webSocketFlow: Flow[Message, Message, 
Future[WebSocketUpgradeResponse]] = webSocketResponse
                 logDuration(handleWebSocketMessages(webSocketFlow))
            }


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to