SlideShare a Scribd company logo
1 of 22
MOUNTEBANK AND
YOU
Nagesh Kumar
nkumar@thoughtworks.com
1
AGENDA
Integration Testing
Isolation Testing
Real Problem
Mountebank
Quick Watch
Whom to Catch
2
Test multiple components at the same time
No GUI
No faking/mocking/stubbing/etc
Need Real things to Integrate With
Real Services must be reliable and need to be fast
THE CLASSICAL VIEW OF INTEGRATION TESTING
3
THE CLASSICAL VIEW OF ISOLATION TESTING
4
Test as many real components at the same time
Stub out the unreliable Real Dependency
Stub out the non-existing Real Dependency
Testing our code while isolating it from the naughty Real
Dependency
YOU CAN’T ALWAYS FIX THE REAL PROBLEM (SAD, BUT TRUE)
5
Real Things being maintained/developed by other teams
Poor testing environment (Hardware, Data, Other)
Fixing the Real Thing is more costly than enduring it
Client won’t pay us to fix the Real Things
WHAT IS MOUNTEBANK?
“mountebank is the
first tool to provide
cross-platform, multi-
protocol test doubles
over the wire.”
- mountebank
6
http://www.mbtest.org/
WHY MOUNTEBANK?
Proprietary
Lacked platform support
Lacked protocol support
Not extensible
Slow
Hard to run during unit test cycle
Managed through a special IDE
7
Existing tools were:
WHAT CAN IT DO FOR ME?
Record live requests and responses to replay later
Imitate a response from scratch
Respond to specific requests via predicates
Track any requests that come its way
8
AN OVERVIEW OF MOUNTEBANK IN ACTION
System
Under Test
Tests
Mountebank
Stub
WHAT DO I NEED TO KNOW IN MB?
Imposters
Predicates
Proxies
Injection
Behaviors
10
WHAT ARE IMPOSTERS?
The imposter is the
most integral part of
mountebank. An
imposter is associated
with a port number
and a protocol. It
contains within itself
the response we want
to return, and other
related information.
11
http://www.mbtest.org/docs/api/stubs
ANATOMY OF AN IMPOSTER
POST /imposters HTTP/1.1
Host: localhost:2525
Accept: application/json
Content-Type: application/json
{
"port": 4545,
"protocol": “http",
"stubs": [
{
"responses": [
{
"is": {
"statusCode": 200, (Will default to 200 if not provided)
“headers": {
“Content-Type": “text/plain“
},
"body": “Hello world!”
}
}
]
}
]
}
12
ANOTHER IMPOSTER EXAMPLE
POST /imposters HTTP/1.1
Host: localhost:2525
Accept: application/json
Content-Type: application/json
{
"port": 4546,
"protocol": "http",
"stubs": [
{
"responses": [
{
"is": {
"statusCode": 201,
“headers": {
“Content-Type": “text/plain“
},
"body": “Created!”
}
},
{
"is": {
"statusCode": 400,
“headers": {
“Content-Type": “text/plain“
},
"body": “ERROR: Already Exists!”
}
}
]
}
]
}
13
WHAT IS A PREDICATE?
The predicate is the
part of an imposter
which determines if a
request should be
responded to by said
imposter.
14
http://www.mbtest.org/docs/api/predicates
TYPES OF PREDICATES
Equals
Deep Equals
Contains
Starts/EndsWith
Matches
Exists
Not/And/Or
Inject
http://www.mbtest.org/docs/api/predicates
15
WHAT CAN A PREDICATE OPERATE ON?
That depends on the
protocol you’re using!
For example, Http
allows you to use
predicates on:
- Method Type
- Query Path
- Request Body
- And More!
16
http://www.mbtest.org/docs/protocols/http
PREDICATE EXAMPLE
{
"port": 4551,
"protocol": "http",
"stubs": [
{
"responses": [
{
"is": {
"statusCode": 201,
"headers": {
"Content-Type": "text/plain"
},
"body": "You posted to me!"
}
}
],
"predicates": [
{
"equals": {
"method": "POST"
}
}
]
}
]
}
17
OR EXAMPLE
{
"port": 4552,
"protocol": "http",
"stubs": [
{
"responses": [
{
"is": {
"statusCode": 201,
"headers": {
"Content-Type": "text/plain"
},
"body": "You posted to me!"
}
}
],
"predicates": [
{
"or": [
{
"equals": {
"method": "POST"
}
},
{
"equals": {
"method": "PUT"
}
}
]
}
]
}
]
}
18
WHAT IS A PROXY?
The proxy is a special
imposter which allows
us to get between our
application and a
service it
communicates with. It
records each request,
forwards it to the
service, and records
the response from that
service.
19
http://www.mbtest.org/docs/api/proxies
BUT WHAT DO I DO WITH IT?
Record responses that would be difficult (if not impossible)
to write by hand
Look at requests to see what distinguishes them from each
other
20
PROXY EXAMPLE
{
"port": 4560,
"protocol": "http",
"name": "duckduckgo",
"stubs": [
{
"responses": [
{
"proxy": {
"to": "http://api.duckduckgo.com/",
"mode": "proxyOnce",
"predicateGenerators": [
{
"matches": {
"method": true,
"path": true,
"query": true
}
}
]
}
}
]
}
]
}
21
Direct all Suggestions to Brandon
(bbyars@thoughtworks.com)
THANK YOU

More Related Content

What's hot

Karate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter ThomasKarate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter Thomasintuit_india
 
Incidents - The Shorter, the Better with the Quality Engineering Discipline
Incidents - The Shorter, the Better with the Quality Engineering DisciplineIncidents - The Shorter, the Better with the Quality Engineering Discipline
Incidents - The Shorter, the Better with the Quality Engineering DisciplineAntoine Craske
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
JMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaJMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaEdureka!
 
Test your microservices with REST-Assured
Test your microservices with REST-AssuredTest your microservices with REST-Assured
Test your microservices with REST-AssuredMichel Schudel
 
Parallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and ZaleniumParallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and ZaleniumEvozon Test Lab
 
Performance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWSPerformance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWSMatthias Matook
 
Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?BugRaptors
 
TOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem Overview
TOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem OverviewTOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem Overview
TOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem OverviewOpenTOSCA
 
Unit Testing with xUnit.net - Part 2
Unit Testing with xUnit.net - Part 2Unit Testing with xUnit.net - Part 2
Unit Testing with xUnit.net - Part 2BizTalk360
 

What's hot (20)

BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
Karate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter ThomasKarate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter Thomas
 
Incidents - The Shorter, the Better with the Quality Engineering Discipline
Incidents - The Shorter, the Better with the Quality Engineering DisciplineIncidents - The Shorter, the Better with the Quality Engineering Discipline
Incidents - The Shorter, the Better with the Quality Engineering Discipline
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
JMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaJMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | Edureka
 
Test automation process
Test automation processTest automation process
Test automation process
 
Appium ppt
Appium pptAppium ppt
Appium ppt
 
Test your microservices with REST-Assured
Test your microservices with REST-AssuredTest your microservices with REST-Assured
Test your microservices with REST-Assured
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
Gatling
Gatling Gatling
Gatling
 
Parallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and ZaleniumParallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and Zalenium
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 
Performance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWSPerformance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWS
 
Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?
 
TOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem Overview
TOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem OverviewTOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem Overview
TOSCA and OpenTOSCA: TOSCA Introduction and OpenTOSCA Ecosystem Overview
 
Unit testing
Unit testingUnit testing
Unit testing
 
VTV Mobile Performace Test
VTV Mobile Performace TestVTV Mobile Performace Test
VTV Mobile Performace Test
 
Unit Testing with xUnit.net - Part 2
Unit Testing with xUnit.net - Part 2Unit Testing with xUnit.net - Part 2
Unit Testing with xUnit.net - Part 2
 

Viewers also liked

Testing & deploying Microservices GeeCon 2014
Testing & deploying Microservices   GeeCon 2014Testing & deploying Microservices   GeeCon 2014
Testing & deploying Microservices GeeCon 2014Sam Newman
 
Spring boot - Getting Started
Spring boot - Getting StartedSpring boot - Getting Started
Spring boot - Getting StartedDavid Schmitz
 
JavaOne 2015: Scalable Continous Deployment with Maven
JavaOne 2015: Scalable Continous Deployment with MavenJavaOne 2015: Scalable Continous Deployment with Maven
JavaOne 2015: Scalable Continous Deployment with MavenAbraham Marin-Perez
 
Resilience testing with Wiremock and Spock
Resilience testing with Wiremock and SpockResilience testing with Wiremock and Spock
Resilience testing with Wiremock and SpockDavid Schmitz
 
Agile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to be
Agile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to beAgile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to be
Agile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to beAbraham Marin-Perez
 
Cursos Agile Think - Lean - 2/4
Cursos Agile Think - Lean - 2/4Cursos Agile Think - Lean - 2/4
Cursos Agile Think - Lean - 2/4André Vidal
 
Increase Your Intelligence 2014
Increase Your Intelligence 2014Increase Your Intelligence 2014
Increase Your Intelligence 2014Andrea Kuszewski
 
Cursos Agile Think - Kanban - 3/4
Cursos Agile Think - Kanban - 3/4Cursos Agile Think - Kanban - 3/4
Cursos Agile Think - Kanban - 3/4André Vidal
 
Cursos Agile Think - Feature Driven Development (FDD) - 4/4
Cursos Agile Think - Feature Driven Development (FDD) - 4/4Cursos Agile Think - Feature Driven Development (FDD) - 4/4
Cursos Agile Think - Feature Driven Development (FDD) - 4/4André Vidal
 
Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be
Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to beExpert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be
Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to beAbraham Marin-Perez
 
Keeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to beKeeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to beAbraham Marin-Perez
 
Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)
Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)
Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)Andrea Kuszewski
 
Cursos Agile Think - Framework Scrum - 1/4
Cursos Agile Think - Framework Scrum - 1/4Cursos Agile Think - Framework Scrum - 1/4
Cursos Agile Think - Framework Scrum - 1/4André Vidal
 
Livro AGILE THINK® CANVAS
Livro AGILE THINK® CANVAS Livro AGILE THINK® CANVAS
Livro AGILE THINK® CANVAS André Vidal
 
Merge hells!! feature toggles to the rescue
Merge hells!! feature toggles to the rescueMerge hells!! feature toggles to the rescue
Merge hells!! feature toggles to the rescueLeena N
 
Keeping Your CI/CD Pipeline as Fast as It Needs to Be
Keeping Your CI/CD Pipeline as Fast as It Needs to BeKeeping Your CI/CD Pipeline as Fast as It Needs to Be
Keeping Your CI/CD Pipeline as Fast as It Needs to BeAbraham Marin-Perez
 
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...OpenWhisk
 
Methodology Patterns (Agile Cambridge 2014)
Methodology Patterns (Agile Cambridge 2014)Methodology Patterns (Agile Cambridge 2014)
Methodology Patterns (Agile Cambridge 2014)Giovanni Asproni
 
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnReactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnZalando Technology
 

Viewers also liked (20)

Testing & deploying Microservices GeeCon 2014
Testing & deploying Microservices   GeeCon 2014Testing & deploying Microservices   GeeCon 2014
Testing & deploying Microservices GeeCon 2014
 
Spring boot - Getting Started
Spring boot - Getting StartedSpring boot - Getting Started
Spring boot - Getting Started
 
JavaOne 2015: Scalable Continous Deployment with Maven
JavaOne 2015: Scalable Continous Deployment with MavenJavaOne 2015: Scalable Continous Deployment with Maven
JavaOne 2015: Scalable Continous Deployment with Maven
 
Resilience testing with Wiremock and Spock
Resilience testing with Wiremock and SpockResilience testing with Wiremock and Spock
Resilience testing with Wiremock and Spock
 
Agile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to be
Agile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to beAgile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to be
Agile roundabout 2017 01 - keeping your ci-cd system as fast as it needs to be
 
Cursos Agile Think - Lean - 2/4
Cursos Agile Think - Lean - 2/4Cursos Agile Think - Lean - 2/4
Cursos Agile Think - Lean - 2/4
 
Increase Your Intelligence 2014
Increase Your Intelligence 2014Increase Your Intelligence 2014
Increase Your Intelligence 2014
 
Cursos Agile Think - Kanban - 3/4
Cursos Agile Think - Kanban - 3/4Cursos Agile Think - Kanban - 3/4
Cursos Agile Think - Kanban - 3/4
 
Cursos Agile Think - Feature Driven Development (FDD) - 4/4
Cursos Agile Think - Feature Driven Development (FDD) - 4/4Cursos Agile Think - Feature Driven Development (FDD) - 4/4
Cursos Agile Think - Feature Driven Development (FDD) - 4/4
 
Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be
Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to beExpert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be
Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be
 
Keeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to beKeeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to be
 
Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)
Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)
Creative Disobedience: How, When and Why to Break the Rules (from BIL 2014)
 
Cursos Agile Think - Framework Scrum - 1/4
Cursos Agile Think - Framework Scrum - 1/4Cursos Agile Think - Framework Scrum - 1/4
Cursos Agile Think - Framework Scrum - 1/4
 
Livro AGILE THINK® CANVAS
Livro AGILE THINK® CANVAS Livro AGILE THINK® CANVAS
Livro AGILE THINK® CANVAS
 
Merge hells!! feature toggles to the rescue
Merge hells!! feature toggles to the rescueMerge hells!! feature toggles to the rescue
Merge hells!! feature toggles to the rescue
 
Keeping Your CI/CD Pipeline as Fast as It Needs to Be
Keeping Your CI/CD Pipeline as Fast as It Needs to BeKeeping Your CI/CD Pipeline as Fast as It Needs to Be
Keeping Your CI/CD Pipeline as Fast as It Needs to Be
 
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
 
Agile Requirements
Agile RequirementsAgile Requirements
Agile Requirements
 
Methodology Patterns (Agile Cambridge 2014)
Methodology Patterns (Agile Cambridge 2014)Methodology Patterns (Agile Cambridge 2014)
Methodology Patterns (Agile Cambridge 2014)
 
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnReactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
 

Similar to Mountebank and you

Petr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraWebExpo
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTPMykhailo Kolesnyk
 
Creating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersCreating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersPaul Balogh
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QAFest
 
Uni w pachube 111108
Uni w pachube 111108Uni w pachube 111108
Uni w pachube 111108Paul Tanner
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java3Pillar Global
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesAlfresco Software
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocratJonathan Linowes
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaYevgeniy Brikman
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...Yevgeniy Brikman
 
Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)Yan Cui
 
2014 Joker - Integration Testing from the Trenches
2014 Joker - Integration Testing from the Trenches2014 Joker - Integration Testing from the Trenches
2014 Joker - Integration Testing from the TrenchesNicolas Fränkel
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesSteve Speicher
 
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...Future Processing
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toNicolas Fränkel
 
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingJava Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingTal Melamed
 

Similar to Mountebank and you (20)

Petr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
 
- Webexpo 2010
- Webexpo 2010- Webexpo 2010
- Webexpo 2010
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
Creating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersCreating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with Testcontainers
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
 
Uni w pachube 111108
Uni w pachube 111108Uni w pachube 111108
Uni w pachube 111108
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API Documentation
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best Practices
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
 
Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)
 
2014 Joker - Integration Testing from the Trenches
2014 Joker - Integration Testing from the Trenches2014 Joker - Integration Testing from the Trenches
2014 Joker - Integration Testing from the Trenches
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
 
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-to
 
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingJava Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
 

More from VodqaBLR

Consumer-Driven Contract Testing PACT
Consumer-Driven Contract Testing PACTConsumer-Driven Contract Testing PACT
Consumer-Driven Contract Testing PACTVodqaBLR
 
Taiko presentation
Taiko presentationTaiko presentation
Taiko presentationVodqaBLR
 
Chatbot Testing
Chatbot TestingChatbot Testing
Chatbot TestingVodqaBLR
 
Key Note VodQA(Bangalore) 2018
Key Note VodQA(Bangalore) 2018Key Note VodQA(Bangalore) 2018
Key Note VodQA(Bangalore) 2018VodqaBLR
 
Android security testing
Android security testingAndroid security testing
Android security testingVodqaBLR
 
Advance appium workshop.pptx
Advance appium workshop.pptxAdvance appium workshop.pptx
Advance appium workshop.pptxVodqaBLR
 
Blockchain workshop
Blockchain workshopBlockchain workshop
Blockchain workshopVodqaBLR
 
Testing natural language processing
Testing natural language processingTesting natural language processing
Testing natural language processingVodqaBLR
 
Drive chrome(headless) with puppeteer
Drive chrome(headless) with puppeteerDrive chrome(headless) with puppeteer
Drive chrome(headless) with puppeteerVodqaBLR
 
Improve your Chaos IQ
Improve your Chaos IQImprove your Chaos IQ
Improve your Chaos IQVodqaBLR
 
WebDriver Lamda - Next Gen Scalable Test
WebDriver Lamda - Next Gen Scalable TestWebDriver Lamda - Next Gen Scalable Test
WebDriver Lamda - Next Gen Scalable TestVodqaBLR
 
Testing Tools with AI
Testing Tools with AITesting Tools with AI
Testing Tools with AIVodqaBLR
 
Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.VodqaBLR
 
Visual testing for Mobile Native Applications
Visual testing for Mobile Native ApplicationsVisual testing for Mobile Native Applications
Visual testing for Mobile Native ApplicationsVodqaBLR
 
Parallel Sim Test using XCUI
Parallel Sim Test using XCUI Parallel Sim Test using XCUI
Parallel Sim Test using XCUI VodqaBLR
 
Performance Testing using Taurus
Performance Testing using TaurusPerformance Testing using Taurus
Performance Testing using TaurusVodqaBLR
 
Writing Maintainable Tests
Writing Maintainable TestsWriting Maintainable Tests
Writing Maintainable TestsVodqaBLR
 
Continuous security testing - sharing responsibility
Continuous security testing - sharing responsibilityContinuous security testing - sharing responsibility
Continuous security testing - sharing responsibilityVodqaBLR
 
ABCing docker with environments - workshop
ABCing docker with environments - workshopABCing docker with environments - workshop
ABCing docker with environments - workshopVodqaBLR
 
Automate Web or Mobile Analytics using TrakMatic
Automate Web or Mobile Analytics using TrakMaticAutomate Web or Mobile Analytics using TrakMatic
Automate Web or Mobile Analytics using TrakMaticVodqaBLR
 

More from VodqaBLR (20)

Consumer-Driven Contract Testing PACT
Consumer-Driven Contract Testing PACTConsumer-Driven Contract Testing PACT
Consumer-Driven Contract Testing PACT
 
Taiko presentation
Taiko presentationTaiko presentation
Taiko presentation
 
Chatbot Testing
Chatbot TestingChatbot Testing
Chatbot Testing
 
Key Note VodQA(Bangalore) 2018
Key Note VodQA(Bangalore) 2018Key Note VodQA(Bangalore) 2018
Key Note VodQA(Bangalore) 2018
 
Android security testing
Android security testingAndroid security testing
Android security testing
 
Advance appium workshop.pptx
Advance appium workshop.pptxAdvance appium workshop.pptx
Advance appium workshop.pptx
 
Blockchain workshop
Blockchain workshopBlockchain workshop
Blockchain workshop
 
Testing natural language processing
Testing natural language processingTesting natural language processing
Testing natural language processing
 
Drive chrome(headless) with puppeteer
Drive chrome(headless) with puppeteerDrive chrome(headless) with puppeteer
Drive chrome(headless) with puppeteer
 
Improve your Chaos IQ
Improve your Chaos IQImprove your Chaos IQ
Improve your Chaos IQ
 
WebDriver Lamda - Next Gen Scalable Test
WebDriver Lamda - Next Gen Scalable TestWebDriver Lamda - Next Gen Scalable Test
WebDriver Lamda - Next Gen Scalable Test
 
Testing Tools with AI
Testing Tools with AITesting Tools with AI
Testing Tools with AI
 
Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.
 
Visual testing for Mobile Native Applications
Visual testing for Mobile Native ApplicationsVisual testing for Mobile Native Applications
Visual testing for Mobile Native Applications
 
Parallel Sim Test using XCUI
Parallel Sim Test using XCUI Parallel Sim Test using XCUI
Parallel Sim Test using XCUI
 
Performance Testing using Taurus
Performance Testing using TaurusPerformance Testing using Taurus
Performance Testing using Taurus
 
Writing Maintainable Tests
Writing Maintainable TestsWriting Maintainable Tests
Writing Maintainable Tests
 
Continuous security testing - sharing responsibility
Continuous security testing - sharing responsibilityContinuous security testing - sharing responsibility
Continuous security testing - sharing responsibility
 
ABCing docker with environments - workshop
ABCing docker with environments - workshopABCing docker with environments - workshop
ABCing docker with environments - workshop
 
Automate Web or Mobile Analytics using TrakMatic
Automate Web or Mobile Analytics using TrakMaticAutomate Web or Mobile Analytics using TrakMatic
Automate Web or Mobile Analytics using TrakMatic
 

Recently uploaded

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Recently uploaded (20)

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

Mountebank and you

  • 2. AGENDA Integration Testing Isolation Testing Real Problem Mountebank Quick Watch Whom to Catch 2
  • 3. Test multiple components at the same time No GUI No faking/mocking/stubbing/etc Need Real things to Integrate With Real Services must be reliable and need to be fast THE CLASSICAL VIEW OF INTEGRATION TESTING 3
  • 4. THE CLASSICAL VIEW OF ISOLATION TESTING 4 Test as many real components at the same time Stub out the unreliable Real Dependency Stub out the non-existing Real Dependency Testing our code while isolating it from the naughty Real Dependency
  • 5. YOU CAN’T ALWAYS FIX THE REAL PROBLEM (SAD, BUT TRUE) 5 Real Things being maintained/developed by other teams Poor testing environment (Hardware, Data, Other) Fixing the Real Thing is more costly than enduring it Client won’t pay us to fix the Real Things
  • 6. WHAT IS MOUNTEBANK? “mountebank is the first tool to provide cross-platform, multi- protocol test doubles over the wire.” - mountebank 6 http://www.mbtest.org/
  • 7. WHY MOUNTEBANK? Proprietary Lacked platform support Lacked protocol support Not extensible Slow Hard to run during unit test cycle Managed through a special IDE 7 Existing tools were:
  • 8. WHAT CAN IT DO FOR ME? Record live requests and responses to replay later Imitate a response from scratch Respond to specific requests via predicates Track any requests that come its way 8
  • 9. AN OVERVIEW OF MOUNTEBANK IN ACTION System Under Test Tests Mountebank Stub
  • 10. WHAT DO I NEED TO KNOW IN MB? Imposters Predicates Proxies Injection Behaviors 10
  • 11. WHAT ARE IMPOSTERS? The imposter is the most integral part of mountebank. An imposter is associated with a port number and a protocol. It contains within itself the response we want to return, and other related information. 11 http://www.mbtest.org/docs/api/stubs
  • 12. ANATOMY OF AN IMPOSTER POST /imposters HTTP/1.1 Host: localhost:2525 Accept: application/json Content-Type: application/json { "port": 4545, "protocol": “http", "stubs": [ { "responses": [ { "is": { "statusCode": 200, (Will default to 200 if not provided) “headers": { “Content-Type": “text/plain“ }, "body": “Hello world!” } } ] } ] } 12
  • 13. ANOTHER IMPOSTER EXAMPLE POST /imposters HTTP/1.1 Host: localhost:2525 Accept: application/json Content-Type: application/json { "port": 4546, "protocol": "http", "stubs": [ { "responses": [ { "is": { "statusCode": 201, “headers": { “Content-Type": “text/plain“ }, "body": “Created!” } }, { "is": { "statusCode": 400, “headers": { “Content-Type": “text/plain“ }, "body": “ERROR: Already Exists!” } } ] } ] } 13
  • 14. WHAT IS A PREDICATE? The predicate is the part of an imposter which determines if a request should be responded to by said imposter. 14 http://www.mbtest.org/docs/api/predicates
  • 15. TYPES OF PREDICATES Equals Deep Equals Contains Starts/EndsWith Matches Exists Not/And/Or Inject http://www.mbtest.org/docs/api/predicates 15
  • 16. WHAT CAN A PREDICATE OPERATE ON? That depends on the protocol you’re using! For example, Http allows you to use predicates on: - Method Type - Query Path - Request Body - And More! 16 http://www.mbtest.org/docs/protocols/http
  • 17. PREDICATE EXAMPLE { "port": 4551, "protocol": "http", "stubs": [ { "responses": [ { "is": { "statusCode": 201, "headers": { "Content-Type": "text/plain" }, "body": "You posted to me!" } } ], "predicates": [ { "equals": { "method": "POST" } } ] } ] } 17
  • 18. OR EXAMPLE { "port": 4552, "protocol": "http", "stubs": [ { "responses": [ { "is": { "statusCode": 201, "headers": { "Content-Type": "text/plain" }, "body": "You posted to me!" } } ], "predicates": [ { "or": [ { "equals": { "method": "POST" } }, { "equals": { "method": "PUT" } } ] } ] } ] } 18
  • 19. WHAT IS A PROXY? The proxy is a special imposter which allows us to get between our application and a service it communicates with. It records each request, forwards it to the service, and records the response from that service. 19 http://www.mbtest.org/docs/api/proxies
  • 20. BUT WHAT DO I DO WITH IT? Record responses that would be difficult (if not impossible) to write by hand Look at requests to see what distinguishes them from each other 20
  • 21. PROXY EXAMPLE { "port": 4560, "protocol": "http", "name": "duckduckgo", "stubs": [ { "responses": [ { "proxy": { "to": "http://api.duckduckgo.com/", "mode": "proxyOnce", "predicateGenerators": [ { "matches": { "method": true, "path": true, "query": true } } ] } } ] } ] } 21
  • 22. Direct all Suggestions to Brandon (bbyars@thoughtworks.com) THANK YOU

Editor's Notes

  1. Replace Real Things with Dependency