MockServer
A server for testing Kotlin Multiplatform applications using HTTP and WebSockets.
A MockServer binds to localhost and allows to enqueue predefined responses using enqueue, enqueueString, enqueueMultipart and enqueueWebSocket
MockServer is very simple and should not be used for production applications. HTTPS is a non-goal as well as performance. Also, MockServer makes no attempt at flow control:
data is read as fast as possible from the network and buffered until takeRequest or awaitAnyRequest is called.
queued responses from enqueue are buffered until they can be transmitted to the network. If you're using MockServer to handle large payloads, it will use a lot of memory.
Types
Functions
Wait for a request and return it.
Enqueue a response.
Return a request from the recorded requests or throw if no request has been received.