SlideShare a Scribd company logo
Vivek Mahajan & Ishaan Madaan
MicroServices Workshop
Flight Reservation Application
Reservation
Service
Flight Details
Service
User Details
Service
Docker & Microservices
Docker Is one of the Reason to make the microservices popular, that helps the software to
build and ship faster.
user details
-mysql
Flight Details
Service
Reservation
Service
flightdetails -
mysql
Reservation-
mysql
User login
Service
7070 9090 6060
Docker Containers
Swagger
● A Good Friend of Qa.
● Rest Api Documentation Api
● Many other Features
http://localhost:7070/userdetails/swagger-ui.html
http://localhost:6060/reservation/swagger-ui.html
http://localhost:9090/flightdetails/swagger-ui.html
.
Unit Tests
UNIT TESTING is a level of software testing where
individual units/ components of a software are tested.
A unit is the smallest testable part of any software,
for eg, a class method.
On which side of the pyramid should the following validations
test lie:
● Passenger.cardNumber.length = 16
● Passenger.firstName.length > 3
● Passenger.lastName.length > 3
● Passenger.phoneNumber.length > 3
● Passenger.phoneNumber contains only numerals
● Passenger.flightId != null
● Passenger.email contains @
● A unit or a method may exhibit multiple behaviors and hence, each behavior
must be tested as a separate test and not all in one.
● Always use mocks for simulating external behavior when testing a method or a
unit in isolation.
Best Practices of writing Unit Tests
@Test
public void validateReservationData() {
Passenger passenger = new Passenger();
passenger.setFirstName("some invalid name");
passenger.setLastName("some invalid name");
passenger.setPhone("some invalid name");
passenger.setEmail("some invalid name");
reservation.setFlight_id(null);
reservation.setPassenger(passenger);
assertTrue("first name is invalid",ReservationValidator
.isValidPassengerName(reservation.getPassenger().getFirstName()));
assertTrue("last name is invalid",ReservationValidator
.isValidPassengerName(reservation.getPassenger().getLastName()));
assertTrue("email is invalid",ReservationValidator
.isValidPassengerName(reservation.getPassenger().getEmail()));
assertTrue("phone is invalid",ReservationValidator
.isValidPassengerName(reservation.getPassenger().getPhone()));
}
Bad Practice
@Test
public void validatePassengerEmail() { }
@Test
public void validatePassengerContact() { }
@Test
public void validateFlightId) { }
@Test
public void validatePassengerEmail() { }
Good Practice
FlightReservation Application
Reservation
Service
Flight Details
Service
Consumer
Producer
FlightReservation Application
Reservation
Service
Flight Details
Service
Consumer
Producer
Mock
Mock
Cheap But Not TrustWorthy
Integration test (Api test)
Reservation
Service
Flight Details
Service
Consumer
Producer
Make the whole
System up and test
the integration
Costly but
trustWorthy
Violates the
concept of
Microservices
(independent(
Contract test
Reservation
Service
Flight Details
Service
Consumer
Producer
Write test on the basis
of initial contract
contract test
file
PACT FRAMEWORK
Microservices workshop
Service Virtualization
● To make the System Persistent
○ Dealing With third party API’s
○ Critical System Dependency
○ Functional Test Flows
● Load Testing
Microservices workshop
MounteBank
MounteBank
● npm install -g mountebank.
● mb start --configfile imposter.json
● Default Port 2525
RECORD NETWORK TRAFFIC & PLAYBACK
Monitoring
● We need to monitor the Services As part of Testing.
● Services should be configured in such a way that an alarm
is raised in case of a failure.
LOGGING
Do We need to Test the Logging??
Questions
Links
GitHub:
https://github.com/ishaanmadaan008/microservices_vodqa
Feedback Url:
https://tinyurl.com/y8fqhnwz

More Related Content

PPTX
node.js errors
PPTX
Full Stack Unit Testing
PDF
Unit Testing Express and Koa Middleware in ES2015
PPT
Testing Javascript with Jasmine
PDF
Redux Thunk - Fu - Fighting with Async
PDF
node.js practical guide to serverside javascript
PDF
Unit Testing Express Middleware
PPTX
Good karma: UX Patterns and Unit Testing in Angular with Karma
node.js errors
Full Stack Unit Testing
Unit Testing Express and Koa Middleware in ES2015
Testing Javascript with Jasmine
Redux Thunk - Fu - Fighting with Async
node.js practical guide to serverside javascript
Unit Testing Express Middleware
Good karma: UX Patterns and Unit Testing in Angular with Karma

What's hot (20)

PPTX
Protractor Training in Pune by QuickITDotnet
KEY
Testing JS with Jasmine
PDF
Introduction to Protractor
PDF
Symfony2 Components - The Event Dispatcher
PDF
MeetJS Summit 2016: React.js enlightenment
PDF
Testing Ruby with Rspec (a beginner's guide)
PDF
Unit Testing with Jest
PDF
Jasmine - why JS tests don't smell fishy
PPTX
Owl: The New Odoo UI Framework
PPT
Assurer - a pluggable server testing/monitoring framework
PDF
Reliable Javascript
PDF
Unit testing after Zend Framework 1.8
PDF
Test-Driven Development of AngularJS Applications
ODP
Angular JS Unit Testing - Overview
PDF
Automated code audits
PDF
Getting testy with Perl
KEY
Php Unit With Zend Framework Zendcon09
PPT
How Danga::Socket handles asynchronous processing and how to write asynchrono...
PPT
Ruby on Rails testing with Rspec
PDF
AngularJS Unit Testing w/Karma and Jasmine
Protractor Training in Pune by QuickITDotnet
Testing JS with Jasmine
Introduction to Protractor
Symfony2 Components - The Event Dispatcher
MeetJS Summit 2016: React.js enlightenment
Testing Ruby with Rspec (a beginner's guide)
Unit Testing with Jest
Jasmine - why JS tests don't smell fishy
Owl: The New Odoo UI Framework
Assurer - a pluggable server testing/monitoring framework
Reliable Javascript
Unit testing after Zend Framework 1.8
Test-Driven Development of AngularJS Applications
Angular JS Unit Testing - Overview
Automated code audits
Getting testy with Perl
Php Unit With Zend Framework Zendcon09
How Danga::Socket handles asynchronous processing and how to write asynchrono...
Ruby on Rails testing with Rspec
AngularJS Unit Testing w/Karma and Jasmine
Ad

Similar to Microservices workshop (20)

PPTX
Security in NodeJS applications
PPTX
Angular js security
PDF
Browser testing with nightwatch.js - Drupal Europe
PDF
How to test complex SaaS applications - The family july 2014
PDF
Unit testing @ WordPress Meetup Tilburg 7 januari 2014
PPTX
SCULPT! YOUR! TESTS!
PDF
Bonnes pratiques de développement avec Node js
PDF
AWS에서 자바스크립트 활용 - 서비스와 개발 도구 - AWS Summit Seoul 2017
PPTX
Resiliency & Security_Ballerina Day CMB 2018
ODP
Unit Testing and Coverage for AngularJS
PDF
Dependency Injection
PDF
Postman On Steroids
PPTX
How Not to Code
PDF
Workshop 5: JavaScript testing
PDF
Spring 3: What's New
PDF
Node.js API 서버 성능 개선기
PPT
Php Security By Mugdha And Anish
KEY
And the Greatest of These Is ... Rack Support
KEY
Writing robust Node.js applications
PDF
Data Validation models
Security in NodeJS applications
Angular js security
Browser testing with nightwatch.js - Drupal Europe
How to test complex SaaS applications - The family july 2014
Unit testing @ WordPress Meetup Tilburg 7 januari 2014
SCULPT! YOUR! TESTS!
Bonnes pratiques de développement avec Node js
AWS에서 자바스크립트 활용 - 서비스와 개발 도구 - AWS Summit Seoul 2017
Resiliency & Security_Ballerina Day CMB 2018
Unit Testing and Coverage for AngularJS
Dependency Injection
Postman On Steroids
How Not to Code
Workshop 5: JavaScript testing
Spring 3: What's New
Node.js API 서버 성능 개선기
Php Security By Mugdha And Anish
And the Greatest of These Is ... Rack Support
Writing robust Node.js applications
Data Validation models
Ad

Recently uploaded (20)

PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
assetexplorer- product-overview - presentation
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPT
Introduction Database Management System for Course Database
PPTX
Introduction to Artificial Intelligence
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Transform Your Business with a Software ERP System
PDF
System and Network Administration Chapter 2
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
System and Network Administraation Chapter 3
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
history of c programming in notes for students .pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Nekopoi APK 2025 free lastest update
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Which alternative to Crystal Reports is best for small or large businesses.pdf
assetexplorer- product-overview - presentation
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction Database Management System for Course Database
Introduction to Artificial Intelligence
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Design an Analysis of Algorithms I-SECS-1021-03
Transform Your Business with a Software ERP System
System and Network Administration Chapter 2
wealthsignaloriginal-com-DS-text-... (1).pdf
Understanding Forklifts - TECH EHS Solution
Operating system designcfffgfgggggggvggggggggg
System and Network Administraation Chapter 3
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Reimagine Home Health with the Power of Agentic AI​
history of c programming in notes for students .pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free

Microservices workshop