Problem: You want to test your Scala code using JUnit.
Solution
Include the JUnit library in your project, and use it in the same way you’ve used it in Java projects, with a few minor changes.
Assuming you’re using SBT on your project, include JUnit into the project by adding this dependency line to your build.sbt file: