https://kotlinlang.org logo
#http4k
Title
# http4k
a

Albert

01/02/2019, 12:48 PM
I am looking at the nonblocking, but I am not sure how to test this. according to https://www.http4k.org/cookbook/websockets/ you can do
testApp.testWsClient
but I need something like
testApp.testWebsocket
d

dave

01/02/2019, 12:52 PM
sorry - not quite understanding what you're trying to do - so will ask questions until I do! 🙂
1. what's the test that you're trying to write? Are you testing the server-side of the ws or the client side?
a

Albert

01/02/2019, 12:56 PM
I try to test client side, and that it responses properly to messages. From the documentation I liked that you could use it for integration and unit testing
d

dave

01/02/2019, 1:02 PM
clarification: are you testing from the client-side (so you're testing a server-side socket), or you are trying to test the client side (eg. so you're injecting the websocket into another class)?
a

Albert

01/02/2019, 1:03 PM
I am trying to test client. I am injection a
Websocket
into a class
d

dave

01/02/2019, 1:14 PM
ok - we don't currently provide a test Websocket implementation for testing the clientside of the websocket. We only provide the tools for testing a server-side websocket
So you'll need to write your own test version of the interface
a

Albert

01/02/2019, 1:15 PM
Ok clear, thanks. I will do that
d

dave

01/02/2019, 1:15 PM
np 🙂