Skip to content

Commit

Permalink
KTOR-4323: Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hfhbd committed Jul 3, 2022
1 parent fa555e3 commit 44b1835
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -45,15 +45,18 @@ class CIOWebSocketTest : WebSocketEngineSuite<CIOApplicationEngine, CIOApplicati
}
}



useSocket {
negotiateHttpWebSocket()

val data = Data(42)
output.writeFrame(Frame.Text(Json.encodeToString(DataSerializer, data)), masking = false)
input.awaitContent()
val incomingData = Json.decodeFromString(DataSerializer, input.toByteArray().decodeToString())
output.flush()

val frame = input.readFrame(Long.MAX_VALUE, 0)
assertIs<Frame.Text>(frame)
val incomingData = Json.decodeFromString(DataSerializer, frame.readText())
assertEquals(data, incomingData)

output.writeFrame(Frame.Close(), false)
output.flush()
assertCloseFrame()
Expand Down

0 comments on commit 44b1835

Please sign in to comment.