Chapter 8. Protocols

This chapter covers

  • How protocols work in mountebank
  • An in-depth look at the TCP protocol
  • How to stub a bespoke text-based TCP protocol
  • How to stub a binary .NET Remoting service

Let’s get real: faking it only gets you so far. At some point, even the best virtual services have to lay down some real bits on the wire.

The functionality we have explored so far—responses, predicates, and behaviors—is largely the realm of stubbing and mocking tools. Those stubbing and mocking tools were created for creating test doubles in process, allowing you to perform focused tests by methodically manipulating dependencies. Responses correspond to what stub functions return, and predicates exist to provide different results based on the ...

Get Testing Microservices with Mountebank now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.