...

/

Testing Against Real External Dependencies

Testing Against Real External Dependencies

Get familiar with integration tests that deal with system interfaces with external components by using the real dependency.

Many applications interact with databases, other services, or third-party APIs. This makes integration testing harder since we have to deal with other running systems to design and run our integration test suite.

There are two main approaches to dealing with an external dependency in tests:

  • Use the real dependency
  • Replace the real dependency with something that doubles as the dependency

Testing using the real dependency

Say a database backs up our application. The database is a dependency ...