24. Unit tests
• Implemented by developers
• Concentrated on positive and corner cases
• Mocking and stubbing are heavily used
25. Integration tests: what to test
• Persistence: SQL and NoSQL storages
• Gateway: HTTP REST, Messaging, RPC,
etc.
26. Integration tests: how to test
• In – memory solutions for testing
• Dependencies in docker containers
• Using SQLUnit / NoSQLUnit / scripts for test data
27. Component tests: what
• Testing main functionality
of the microservice
• Testing corner cases if
external services are
unavailable
28. Component tests: how to test
• Testing through public / internal API
• Running service locally and / or dependencies in docker containers
Test Containers: https://bit.ly/2KYhc4N
Spring Boot Test Containers: https://bit.ly/2GTc13S
• Mocking out external services: e.g. via WireMock https://bit.ly/2pSFLZb
37. Recommendations
• Sam Newman – Building Microservices https://oreil.ly/1pp6qmx
• Martin Fowler – Testing Strategies in Microservices
https://bit.ly/2pWi0AA
38. To sum up:
• Automate each microservice separately
• Run locally as much tests as you can
• End - to - end tests are important too