Upload
sriram-angajala
View
7
Download
1
Embed Size (px)
Citation preview
Eurostar Innovation week 2Mocking 3rd Party Services
Date 3nd September 2015
About Zombies.. Continued from yesterday’s Circuit Breakers
• If Eurostar customers may behave like Zombies when EIF is down(1 hour/1 day per week).. then what about Eurostar Testers who
access Eurostar sites (24/7) …
This is what it happens….News from Eurostar Bulletin
Current System
If 3rd Party services are unstable / unavailable…
• Delays testing progress Tests fail – need to be re-tested either
Manually Automated (False positives given)
Gives inaccurate results of front end code• Can’t emulate real time scenarios
Unable to test production issues Error conditions cannot be tested (e.g Payment, GDS)
• 3rd party services response is slow (performance)
Introduction of Mock Envs
Tools Evaluated
– Wiremock– Apiary– Mockable.IO– Soap UI– Charles
Breakdown of tools
Wiremock– How it works
• Java application is created at backend• Deployed as normal web application and have json files fulfilling
requests• End points diverted to mock services
– Pros• Emulates any test condition• Handles multiple requests on single URL (POST requests)• Full control over responses
– Cons• Complex programming• Maintenance overheads
Breakdown of tools cont…
Soap UI– How it works
• Responses as per preconfigured JSON files• Uses groovy scripts to programme(light weight)
– Pros• Simple to mock environment• Handles multiple requests (GET requests)• Usable for all static responses & happy paths• No maintenance overhead
– Cons
• Running in Jenkins server• Running from command line like a real server is not easy
Breakdown of tools cont…
Apiary & Mockable.IO– How it works
• Free online tool• Blueprint syntax (Apiary only)• Responses as per preconfigured JSON files
– Pros• Simple to mock environment• Handles multiple requests (GET requests)• Usable for all static responses & happy paths• No maintenance overhead• Full documentation available (Apiary only)
– Cons• Unable to manipulate responses• Payload cannot be validated• Negative conditions not testable
Summary
Challenges of mocking services•Time effective to build •3rd party maintenance / changes communications•Maintenance of mock services in line with 3rd party service upgrades and changes
Summary
Benefits of mocking services•Independent frontend testing•Rapid test completion•Faster feedback •More combinations testable•Isolated testing
•Error scenario simulation•More controlled services•Mock services support TDD•Supports POC on all platforms•Faster = Saved effort = Saved Time = Saved £££