Run JUnit5 command-line

Running Junit5 from command-line requires junit-platform-console-standalone jar. Download jar from below.

Command to run unit tests of a specific package

java -jar ~/useful_jars/junit-platform-console-standalone-1.7.1.jar — class-path=build/classes/java/test:build/classes/java/main — select-package=com.example.project

Command to run unit tests of a specific class

java -jar ~/useful_jars/junit-platform-console-standalone-1.7.1.jar — class-path=build/classes/java/test:build/classes/java/main — select-class=com.example.project.CalculatorTests

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store