Testing Microservices with Mountebank
Summary

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.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

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.

Table of Contents

    PART 1 - FIRST STEPS
  1. Testing microservices
  2. Taking mountebank for a test drive
  3. PART 2 - USING MOUNTEBANK
  4. Testing using canned responses
  5. Using predicates to send different responses
  6. Adding record/replay behavior
  7. Programming mountebank
  8. Adding behaviors
  9. Protocols
  10. PART 3 - CLOSING THE LOOP
  11. Mountebank and continuous delivery
  12. Performance testing with mountebank
1127152365
Testing Microservices with Mountebank
Summary

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.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

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.

Table of Contents

    PART 1 - FIRST STEPS
  1. Testing microservices
  2. Taking mountebank for a test drive
  3. PART 2 - USING MOUNTEBANK
  4. Testing using canned responses
  5. Using predicates to send different responses
  6. Adding record/replay behavior
  7. Programming mountebank
  8. Adding behaviors
  9. Protocols
  10. PART 3 - CLOSING THE LOOP
  11. Mountebank and continuous delivery
  12. Performance testing with mountebank
38.99 In Stock
Testing Microservices with Mountebank

Testing Microservices with Mountebank

by Brandon Byars
Testing Microservices with Mountebank

Testing Microservices with Mountebank

by Brandon Byars

eBook

$38.99 

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Summary

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.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

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.

Table of Contents

    PART 1 - FIRST STEPS
  1. Testing microservices
  2. Taking mountebank for a test drive
  3. PART 2 - USING MOUNTEBANK
  4. Testing using canned responses
  5. Using predicates to send different responses
  6. Adding record/replay behavior
  7. Programming mountebank
  8. Adding behaviors
  9. Protocols
  10. PART 3 - CLOSING THE LOOP
  11. Mountebank and continuous delivery
  12. Performance testing with mountebank

Product Details

ISBN-13: 9781638356103
Publisher: Manning
Publication date: 12/01/2018
Sold by: SIMON & SCHUSTER
Format: eBook
Pages: 240
File size: 5 MB

About the Author

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

Table of Contents

Preface ix

Acknowledgments x

About this book xii

About the author xv

About the cover illustration xvi

Part 1 First Steps 1

1 Testing microservices 3

1.1 A microservices refresher 4

The path toward microservices 5

Microservices and organizational structure 7

1.2 The problem with end-to-end testing 9

1.3 Understanding service visualization 11

Test-by-test setup using an API 13

Using a persistent, data store 14

Record and replay 14

1.4 Introducing mountebank 16

1.5 The service virmalization tool ecosystem 20

2 Taking mountebank for a test drive 22

2.1 Setting up the example 23

2.2 HTTP and mountebank: a primer 24

2.3 Virtualizing the product catalog service 27

2.4 Your first test 33

Part 2 Using Mountebank 41

3 Testing using canned responses 43

3.1 The basics of canned responses 44

The default response 46

Understanding how the default response works 49

Changing the default response 49

Cycling through responses 50

3.2 HTTPS imposters 52

Selling up a trusted HI TPS imposter 56

Using mutual authentication 58

3.3 Saving the responses in a configuration file 59

Saving multiple imposters in the config file 61

4 Using predicates to send different responses 65

4.1 The basics of predicates 66

Types of predicates 68

Matching object request fields 74

The deepequals predicate 75

Matching multivalued fields 76

The exists predicate 77

Conjunction junction 78

A complete list of predicate types 80

4.2 Parameterizing predicates 80

Making case-sensitive predicates 80

4.3 Using predicates on JSON values 81

Using direct JSON predicates 81

Selecting a JSON value with JSONPath 82

4.4 Selecting XML values 83

5 Adding record/replay behavior 87

5.1 Selling up a proxy 88

5.2 Generating the correct predicates 91

Creating predicates with predicates with predicateGenerators 91

Adding predicate parameters 93

5.3 Capturing multiple responses for the same request 96

5.4 Ways to replay a proxy 100

5.5 Configuring the proxy 102

Using mutual authentication 102

Adding custom headers 103

5.6 Proxy use cases 105

Using a proxy as a fallback 105

Converting HTTPS to HTTP 106

6 Programming mountebank 108

6.1 Creating your own predicate 109

6.2 Creating your own dynamic response 114

Adding state 116

Adding async 117

Deciding between response vs. predicate injection 126

6.3 A word of caution: security matters 127

6.4 Debugging tips 128

7 Adding behaviors 130

7.1 Understanding behaviors 131

7.2 Decorating a response 132

Using the decorate function 132

Adding decoration to saved proxy responses 134

Adding middleware through shellTransform 137

7.3 Adding latency to a response 139

7.4 Repeating a response multiple times 140

7.5 Replacing content in the response 141

Copying request data to the response 141

Looking up data from an external data source 148

7.6 A complete list of behaviors 152

8 Protocols 153

8.1 How protocols work in mountebank 154

8.2 A TCP primer 155

8.3 Stubbing text-based TCP-based RPC 157

Creating a basic TCP imposter 158

Creating a TOP proxy 159

Matching and manipulating an XML payload 161

8.4 Binary support 162

Using binary mode with Base64 encoding 162

Using predicates in binary mode 163

8.5 Virtualizing a .NET Remoting service 164

Creating a simple .NET Remoting client 165

Virtualizing the .NET Remoting server 167

How to tell mountebank where the message ends 171

Part 3 Closing the Loop 177

9 Mountebank and continuous delivery 179

9.1 A continuous delivery refresher 180

Testing strategy for CD with microservices 182

Mapping your testing strategy to a deployment pipeline 185

9.2 Creating a test pipeline 186

Creating unit tests 187

Creating service tests 191

Balancing service virtualizalion with contract tests 194

Exploratory testing 198

10 Performance testing with mountebank 201

10.1 Why service visualization enables performance testing 202

10.2 Defining your scenarios 204

10.3 Capturing the test data 206

Capturing the responses 207

Capturing the actual latencies 208

Simulating wild latency swings 209

10.4 Running the performance tests 210

10.5 Scaling mountebank 212

Index 217

From the B&N Reads Blog

Customer Reviews