Preface |
|
ix | |
Acknowledgments |
|
x | |
About This Book |
|
xii | |
About The Author |
|
xv | |
About The Cover Illustration |
|
xvi | |
Part 1: First Steps |
|
1 | (40) |
|
|
3 | (19) |
|
1.1 A microservices refresher |
|
|
4 | (5) |
|
The path toward microservices |
|
|
5 | (2) |
|
Microservices and organizational structure |
|
|
7 | (2) |
|
1.2 The problem with end-to-end testing |
|
|
9 | (2) |
|
1.3 Understanding service virtualization |
|
|
11 | (5) |
|
Test-by-test setup using an API |
|
|
13 | (1) |
|
Using a persistent data store |
|
|
14 | (1) |
|
|
14 | (2) |
|
1.4 Introducing mountebank |
|
|
16 | (4) |
|
1.5 The service virtualization tool ecosystem |
|
|
20 | (2) |
|
2 Taking mountebank for a test drive |
|
|
22 | (19) |
|
2.1 Setting up the example |
|
|
23 | (1) |
|
2.2 HTTP and mountebank: a primer |
|
|
24 | (3) |
|
2.3 Virtualizing the product catalog service |
|
|
27 | (6) |
|
|
33 | (8) |
Part 2: Using Mountebank |
|
41 | (136) |
|
3 Testing using canned responses |
|
|
43 | (22) |
|
3.1 The basics of canned responses |
|
|
44 | (8) |
|
|
46 | (3) |
|
Understanding how the default response works |
|
|
49 | (1) |
|
Changing the default response |
|
|
49 | (1) |
|
Cycling through responses |
|
|
50 | (2) |
|
|
52 | (7) |
|
Setting up a trusted HTTPS imposter |
|
|
56 | (2) |
|
Using mutual authentication |
|
|
58 | (1) |
|
3.3 Saving the responses in a configuration file |
|
|
59 | (6) |
|
Saving multiple imposters in the config file |
|
|
61 | (4) |
|
4 Using predicates to send different responses |
|
|
65 | (22) |
|
4.1 The basics of predicates |
|
|
66 | (14) |
|
|
68 | (6) |
|
Matching object request fields |
|
|
74 | (1) |
|
|
75 | (1) |
|
Matching multivalued fields |
|
|
76 | (1) |
|
|
77 | (1) |
|
|
78 | (2) |
|
A complete list of predicate types |
|
|
80 | (1) |
|
4.2 Parameterizing predicates |
|
|
80 | (1) |
|
Making case-sensitive predicates |
|
|
80 | (1) |
|
4.3 Using predicates on JSON values |
|
|
81 | (2) |
|
Using direct JS ON predicates |
|
|
81 | (1) |
|
Selecting a JSON value with JSONPath |
|
|
82 | (1) |
|
|
83 | (4) |
|
5 Adding record/replay behavior |
|
|
87 | (21) |
|
|
88 | (3) |
|
5.2 Generating the correct predicates |
|
|
91 | (5) |
|
Creating predicates with predicateGenerators |
|
|
91 | (2) |
|
Adding predicate parameters |
|
|
93 | (3) |
|
5.3 Capturing multiple responses for the same request |
|
|
96 | (4) |
|
5.4 Ways to replay a proxy |
|
|
100 | (2) |
|
5.5 Configuring the proxy |
|
|
102 | (3) |
|
Using mutual authentication |
|
|
102 | (1) |
|
|
103 | (2) |
|
|
105 | (3) |
|
Using a proxy as a fallback |
|
|
105 | (1) |
|
|
106 | (2) |
|
|
108 | (22) |
|
6.1 Creating your own predicate |
|
|
109 | (5) |
|
6.2 Creating your own dynamic response |
|
|
114 | (13) |
|
|
116 | (1) |
|
|
117 | (9) |
|
Deciding between response vs. predicate injection |
|
|
126 | (1) |
|
6.3 A word of caution: security matters |
|
|
127 | (1) |
|
|
128 | (2) |
|
|
130 | (23) |
|
7.1 Understanding behaviors |
|
|
131 | (1) |
|
7.2 Decorating a response |
|
|
132 | (7) |
|
Using the decorate function |
|
|
132 | (2) |
|
Adding decoration to saved proxy responses |
|
|
134 | (3) |
|
Adding middleware through shellTransform |
|
|
137 | (2) |
|
7.3 Adding latency to a response |
|
|
139 | (1) |
|
7.4 Repeating a response multiple times |
|
|
140 | (1) |
|
7.5 Replacing content in the response |
|
|
141 | (11) |
|
Copying request data to the response |
|
|
141 | (7) |
|
Looking up data from an external data source |
|
|
148 | (4) |
|
7.6 A complete list of behaviors |
|
|
152 | (1) |
|
|
153 | (24) |
|
8.1 How protocols work in mountebank |
|
|
154 | (1) |
|
|
155 | (2) |
|
8.3 Stubbing text-based TCP-based RPC |
|
|
157 | (5) |
|
Creating a basic TCP imposter |
|
|
158 | (1) |
|
|
159 | (2) |
|
Matching and manipulating an XML payload |
|
|
161 | (1) |
|
|
162 | (2) |
|
Using binary mode with Base64 encoding |
|
|
162 | (1) |
|
Using predicates in binary mode |
|
|
163 | (1) |
|
8.5 Virtualizing a .NET Remoting service |
|
|
164 | (15) |
|
Creating a simple .NET Remoting client |
|
|
165 | (2) |
|
Virtualizing the .NET Remoting server |
|
|
167 | (4) |
|
How to tell mountebank where the message ends |
|
|
171 | (6) |
Part 3: Closing The Loop |
|
177 | (40) |
|
9 Mountebank and continuous delivery |
|
|
179 | (22) |
|
9.1 A continuous delivery refresher |
|
|
180 | (6) |
|
Testing strategy for CD with microservices |
|
|
182 | (3) |
|
Mapping your testing strategy to a deployment pipeline |
|
|
185 | (1) |
|
9.2 Creating a test pipeline |
|
|
186 | (15) |
|
|
187 | (4) |
|
|
191 | (3) |
|
Balancing service virtualization with contract tests |
|
|
194 | (4) |
|
|
198 | (3) |
|
10 Performance testing with mountebank |
|
|
201 | (16) |
|
10.1 Why service virtualization enables performance testing |
|
|
202 | (2) |
|
10.2 Defining your scenarios |
|
|
204 | (2) |
|
10.3 Capturing the test data |
|
|
206 | (4) |
|
|
207 | (1) |
|
Capturing the actual latencies |
|
|
208 | (1) |
|
Simulating wild latency swings |
|
|
209 | (1) |
|
10.4 Running the performance tests |
|
|
210 | (2) |
|
|
212 | (5) |
Index |
|
217 | |