resgateio / resgate

A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly.
https://resgate.io
MIT License
685 stars 67 forks source link

Integration tests #40

Closed jirenius closed 6 years ago

jirenius commented 6 years ago

Story

Integration tests should be added to ensure that Resgate complies with the RES client-, and service protocol specification.

Notes

Mocking both the NATS client behaviour as well as the WebSocket client connection, tests can be made that sends client requests, validates and replies to requests posted on NATS, and validates the responses to the client.

Mocking NATS

By creating a testnats struct that implements the mq.Client interface, NATS client may be mocked.

Mocking WebSocket client

By using github.com/posener/wstest, the clients may be mocked as well.

jirenius commented 6 years ago

Fixed in: https://github.com/jirenius/resgate/pull/41