-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support for lower-level TCP and UDP connections #204
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@nyurik sounds interesting but I think I would have to introduce a new type |
Yeah, I was a bit torn on that one too. We would definitely need separate TCP and UDP servers. The infrastructure to keep a pool of them, communication channels between the server and the testing framework, assertion that a mock has been executed, and possibly other plumbing might be relevant. Async stuff might also be highly desirable, and a bit of a pain to duplicate. HTTP is fundamentally based on request response, while (in theory) TCP / UDP could be more of an independent two way communication / time based /..., although of course most cases it will still be a simple request/response, only at a lower - bytes level. So if it would be possible to reuse the plumbing, while providing separate set of servers and expectation API, it would be a good addition to your lib - one stop network testing harness. If not, than yeah, a separate lib that replicates a lot of the hard work you did. The biggest issue with the socket-server-mocker is that it is relatively new and has some rough around the edges spots that will need to be worked through. |
Mockito does a great job at the HTTP level, but at times I would like to test lower level clients that send UDP or TCP packets. While this is clearly different from the
server.mock(...) -> Mock
object, some of themockito
infrastructure may still apply.Usage example:
Other matching could help examine the received data, validate it, respond differently depending on the content, etc
P.S. https://github.com/thomasarmel/socket-server-mocker is a similar effort that might benefit from joining
mockito
project?The text was updated successfully, but these errors were encountered: