Integration testing
Integration testing is also known as system testing; it tests the interactions of multiple units working together. All units should work well individually as we've already performed unit testing to confirm that, and integration testing involves testing application classes in the context of their surrounding infrastructure without running the entire project. Use the Apache DBCP connection pool instead of a container-provider pool obtained through JNDI, and use ActiveMQ to avoid expensive commercial JMS licenses.
Let's see the following diagram about integration testing:
As you can see in the preceding diagram, AccountServiceImpl
is using the actual AccountRepository
implementation instead of its stub implementation as we have used in the unit tests. But JpaAccountRepository
will fetch data from the testing DB instead of the production DB. Spring supports integration testing using the Spring-test.jar
library, and Spring can use the same application configuration for the testing...