Testing Microservices with Mountebank

Book description

Testing Microservices with Mountebank is your guide to the ins and outs of testing microservices with service virtualization. The book offers unique insights into microservices application design and state-of-the-art testing practices that will deepen your microservices skills and improve your applications.

About the Technology

Even if you lab test each service in isolation, it’s challenging—and potentially dangerous—to test a live microservices system that’s changing and growing. Fortunately, you can use Mountebank to “imitate” the components of a distributed microservices application to give you a good approximation of the runtime conditions as you test individual services.




About the Book

Testing Microservices with Mountebank introduces the powerful practice of service virtualization. In it, author Brandon Byars, Mountebank’s creator, offers unique insights into microservices application design and state-of-the-art testing practices. You’ll expand your understanding of microservices as you work with Mountebank’s imposters, responses, behaviors, and programmability. By mastering the powerful testing techniques in this unique book, your microservices skills will deepen and your applications will improve. For real.



What's Inside

  • The core concepts of service virtualization
  • Testing using canned responses
  • Programming Mountebank
  • Performance testing


About the Reader

Written for developers familiar with SOA or microservices systems.



About the Author

Brandon Byars is the author and chief maintainer of Mountebank and a principal consultant at ThoughtWorks.



Quotes
A complete and practical introduction to service virtualization using Mountebank, with lots of usable examples.
- Alain Couniot

All you need to know to get microservices testing up and running efficiently and effectively.
- Bonnie Bailey

Shows how to test your microservices and maintain them. You’ll learn that tests don’t need to be so hard!
- Alessandro Campeis

A must-have for anyone who is serious about testing microservices. Covers a lot of patterns and best practices that are valuable for promoting service isolation.
- Nick McGinness

Table of contents

  1. Copyright
  2. Brief Table of Contents
  3. Table of Contents
  4. Preface
  5. Acknowledgments
  6. About this book
  7. About the author
  8. About the cover illustration
  9. Part 1. First Steps
    1. Chapter 1. Testing microservices
      1. 1.1. A microservices refresher
      2. 1.2. The problem with end-to-end testing
      3. 1.3. Understanding service virtualization
      4. 1.4. Introducing mountebank
      5. 1.5. The service virtualization tool ecosystem
      6. Summary
    2. Chapter 2. Taking mountebank for a test drive
      1. 2.1. Setting up the example
      2. 2.2. HTTP and mountebank: a primer
      3. 2.3. Virtualizing the product catalog service
      4. 2.4. Your first test
      5. Summary
  10. Part 2. Using mountebank
    1. Chapter 3. Testing using canned responses
      1. 3.1. The basics of canned responses
      2. 3.2. HTTPS imposters
      3. 3.3. Saving the responses in a configuration file
      4. Summary
    2. Chapter 4. Using predicates to send different responses
      1. 4.1. The basics of predicates
      2. 4.2. Parameterizing predicates
      3. 4.3. Using predicates on JSON values
      4. 4.4. Selecting XML values
      5. Summary
    3. Chapter 5. Adding record/replay behavior
      1. 5.1. Setting up a proxy
      2. 5.2. Generating the correct predicates
      3. 5.3. Capturing multiple responses for the same request
      4. 5.4. Ways to replay a proxy
      5. 5.5. Configuring the proxy
      6. 5.6. Proxy use cases
      7. Summary
    4. Chapter 6. Programming mountebank
      1. 6.1. Creating your own predicate
      2. 6.2. Creating your own dynamic response
      3. 6.3. A word of caution: security matters
      4. 6.4. Debugging tips
      5. Summary
    5. Chapter 7. Adding behaviors
      1. 7.1. Understanding behaviors
      2. 7.2. Decorating a response
      3. 7.3. Adding latency to a response
      4. 7.4. Repeating a response multiple times
      5. 7.5. Replacing content in the response
      6. 7.6. A complete list of behaviors
      7. Summary
    6. Chapter 8. Protocols
      1. 8.1. How protocols work in mountebank
      2. 8.2. A TCP primer
      3. 8.3. Stubbing text-based TCP-based RPC
      4. 8.4. Binary support
      5. 8.5. Virtualizing a .NET Remoting service
      6. Summary
  11. Part 3. Closing the Loop
    1. Chapter 9. Mountebank and continuous delivery
      1. 9.1. A continuous delivery refresher
      2. 9.2. Creating a test pipeline
      3. Summary
    2. Chapter 10. Performance testing with mountebank
      1. 10.1. Why service virtualization enables performance testing
      2. 10.2. Defining your scenarios
      3. 10.3. Capturing the test data
      4. 10.4. Running the performance tests
      5. 10.5. Scaling mountebank
      6. Summary
  12. Index
  13. List of Figures
  14. List of Tables
  15. List of Listings

Product information

  • Title: Testing Microservices with Mountebank
  • Author(s): Brandon Byars
  • Release date: December 2018
  • Publisher(s): Manning Publications
  • ISBN: 9781617294778