Daily Archives: February 24, 2018

Getting Started with JUnit 5: Test your Spring MVC Application with it

In this post, we described how to use JUnit 5 to test your Spring MVC application with Maven. Setup Maven Dependencies We can get the required dependencies by declaring the junit-jupiter-api (version 5.x) dependency in our pom.xml file. This dependency provides the public API for writing tests and extensions. If we are using an IDE that is bundled with an older JUnit 5 version, it throws an exception when we try to run our unit tests by using our IDE. We can fix this problem by adding the following dependency to our POM file: The junit-platform-launcher provides a public API for configuring and launching tests. The API is typically used by IDEs and build tools. To test the Spring application,…

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com