Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket support #33

Open
cpick opened this issue Jun 7, 2018 · 6 comments
Open

WebSocket support #33

cpick opened this issue Jun 7, 2018 · 6 comments
Labels

Comments

@cpick
Copy link

cpick commented Jun 7, 2018

I've been using Mockito to test my RESTy client code and I've recently started using some WebSocket endpoints as well.

Is there any interest in/has there been any thought about adding WebSocket mocking to Mockito?

If there is interest, I may be able to spend some time on it.

@lipanski
Copy link
Owner

lipanski commented Jun 8, 2018

hi @cpick

I think this crate could include websocket support as long as it doesn't complicate things. the http_muncher crate that I use to parse http has some websocket support afaik (it's based on the node http parser).

PRs are welcome 🍰

@sterlingjensen
Copy link
Contributor

I need this as well, but before I get into it implementing it - how open is the project to a dependency on http and maybe websocket? I ask because that would change the center of gravity on this project from: a 'nothing up your sleeves' barebone http server plus test harness, to: just a test harness. That would be bad for a learning project, but good for a production crate. Is that ok with you @lipanski? I'd be happy to give it a go, so long as I can avoid dragging in futures.

@lipanski
Copy link
Owner

@sterlingjensen is there any way to allow mocking websockets without pulling in big dependencies? I'd prefer that, even if writing websocket tests would be a bit more verbose than without the extra dependencies. websockets are not such a common test scenario so I'd rather not have everyone depend on additional crates because of that (or at least not on big crates).

@sterlingjensen
Copy link
Contributor

@lipanski not without writing a websocket server and client. I've been working on a greenfield implementation, because you're right - it wouldn't make sense to pull in a dependency that reimplements so much existing functionality.

@vasilakisfil
Copy link

I would also need support for websockets :/ Websockets are becoming more and more common..

@lipanski I think it's fine as long as the websocket support is put under a feature flag ? So that you don't pull in all dependencies if you want to mock just http requests.

@ghost
Copy link

ghost commented Jun 24, 2020

Any libraries that can be used while this get implemented in mockito?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants