This section provides a detailed insight of how JUnit 5 can be used in conjunction with third-party frameworks, libraries, and platforms. Thanks to the Jupiter extension model, developers can create extensions which allows seamless integration with external frameworks to JUnit 5. First, we have seen the MockitoExtension, an extension provided by the JUnit 5 team to use Mockito (a notorious mock framework for Java) in Jupiter tests. Then, we have used the SpringExtension, which is the official extension provided in the version 5 of the Spring Framework. This extension integrates Spring into the JUnit 5 programming model. This way, we are able to use Spring’s application contexts (that is, the Spring’s DI container) in our tests.
We have also reviewed the SeleniumExtension implemented by selenium-jupiter, an open source project providing a JUnit 5 extension...