Unit test covers all business logic in service layer and Component test covers business flow/cooperation of each layer

Integration tests

  • ✅ verify whether many separately developed modules work together as expected

but

  • ❌ introduce dependencies

  • ❌ give slow feedback

  • ❌ break easily

  • ❌ require lots of maintenance

  • ❌ ability to develop the consumer before provider

When do we run integration test

How do we seed test data

When we call an external service(the external service may call other services as well) in our integration test, the difficulty part is how do we manage test data.

  • Integration test involves multiple service/database

  • Most of request(POST/DELETE/PUT etc) have side effects

Or

We may need to evaluate some alternatives

API test

Contract test

Attachments: