This build will always fail because it has 2 examples of failing tests: one because of a defect in the SUT (system under test), and one because of an error in the test itself.
- Simple hello world example
- Experience with Git source code management
- Building with SBT
- Automated unit testing with JUnit
- Continuous integration with GitHub Actions
- Java 11 SDK or later (Java 17 LTS release recommended)
- SBT
Without command-line arguments:
$ sbt run
With specific command-line arguments:
$ sbt "run arg1 arg2 arg3"
$ sbt test
$ sbt jacocoReport
You can then view the report in a web browser.
On macOS:
$ open target/scala-2.12/jacoco/report/html/index.html
On Linux:
$ xdg-open target/scala-2.12/jacoco/report/html/index.html
On Windows: please let me know if you know how to do this from the WSL command line. Otherwise you can open the index file in your web browser.
This allows passing command-line arguments directly:
On Linux or macOS:
$ sbt stage
$ ./target/universal/stage/bin/hello-java arg1 arg2 arg3
On Windows:
> sbt stage
> .\target\universal\stage\bin\hello-java arg1 arg2 arg3