This session is focused on Consumer-driven Contract Testing. It’s a software testing methodology used to create a data pipeline automation testing framework. We can test microservices use of this framework. We introduce how we can use contract testing, how it works and why we need this methodology, and the architecture of PACT.
2. Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your mobile devices in silent
mode, feel free to move out of
session in case you need to attend
an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
3. Agenda
01 What is Contract Testing ?
02 What is Consumer Driven Contract ?
03 Why do we need CDC ?
04 Architecture of PACT
05 Demo
4. What is Contract Testing?
“Contract testing is a technique for testing an integration point by checking
each application in isolation to ensure the messages it sends or receives
conform to a shared understanding that is documented in a "contract”.
➢ Consumer
➢ Provider
There are two perspective in Contract testing:
5. How does contract connect with microservice?
● Consumer-Microservice and
Producer-Microservice depends on each other
in Contract Testing.
7. 7
Consumer Driven Contract Test
● Consumer driven contract testing is a type of contract
testing that ensures that a provider is compatible with the
expectations that the consumer has of it.
● Consumer-driven contract tests are actually integration tests
that are targetting your API, whether it’s REST-based or
messaging-based.
10. 10
Why do we need CDC ?
➢ Unit Tests
○ Local
○ Just testing a unit
➢ Integration Tests
○ Complex
○ Slow
11. 11
Contract test over end to end Integration test
● Run Fast
● Easier to maintain
● Easy to debug and fix
● Repeatable and scalable
● Catch the issue, which consumer broken
14. 14
Architecture of PACT
Verify the valid PACT ?
● PACT
○ Having Consumer and provider details.
○ Having Interactions.
○ Having matching rules & metadata.
15. Flow of CDC testing
STEP 1
Run/Start the
Services
STEP 2
Run the Consumer
driven Test
STEP 4
Verify the Pact from
Provider side
A B C D
Publish the Pact into
Pact Broker
STEP 3