SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testingb4usolution .
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google MockICS
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway Chris Mague
 
Software Tester Resume Asheesh
Software Tester Resume AsheeshSoftware Tester Resume Asheesh
Software Tester Resume AsheeshAsheesh Minhas
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkSVDevOps
 
Connecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL EndpointsConnecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL EndpointsJulien Bataillé
 
API Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfAPI Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfVishwas N
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing PyramidNaresh Jain
 
SSL Pinning and Bypasses: Android and iOS
SSL Pinning and Bypasses: Android and iOSSSL Pinning and Bypasses: Android and iOS
SSL Pinning and Bypasses: Android and iOSAnant Shrivastava
 
Evolution of netflix conductor
Evolution of netflix conductorEvolution of netflix conductor
Evolution of netflix conductorvedu12
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsQASymphony
 
Postman 101 for Students
Postman 101 for StudentsPostman 101 for Students
Postman 101 for StudentsPostman
 
Introduction to Kubernetes RBAC
Introduction to Kubernetes RBACIntroduction to Kubernetes RBAC
Introduction to Kubernetes RBACKublr
 
Monitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusMonitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusChandresh Pancholi
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with PrometheusQAware GmbH
 

Was ist angesagt? (20)

Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testing
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
Software Tester Resume Asheesh
Software Tester Resume AsheeshSoftware Tester Resume Asheesh
Software Tester Resume Asheesh
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 
Connecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL EndpointsConnecting the Dots: Kong for GraphQL Endpoints
Connecting the Dots: Kong for GraphQL Endpoints
 
API Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfAPI Testing and Hacking (1).pdf
API Testing and Hacking (1).pdf
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
 
Swagger UI
Swagger UISwagger UI
Swagger UI
 
SSL Pinning and Bypasses: Android and iOS
SSL Pinning and Bypasses: Android and iOSSSL Pinning and Bypasses: Android and iOS
SSL Pinning and Bypasses: Android and iOS
 
Introduction to Chaos Engineering
Introduction to Chaos EngineeringIntroduction to Chaos Engineering
Introduction to Chaos Engineering
 
Evolution of netflix conductor
Evolution of netflix conductorEvolution of netflix conductor
Evolution of netflix conductor
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
 
Postman 101 for Students
Postman 101 for StudentsPostman 101 for Students
Postman 101 for Students
 
Introduction to Kubernetes RBAC
Introduction to Kubernetes RBACIntroduction to Kubernetes RBAC
Introduction to Kubernetes RBAC
 
Monitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusMonitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheus
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with Prometheus
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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 AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Kürzlich hochgeladen (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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 AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

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

Hinweis der Redaktion

  1. Replace Real Things with Dependency