diff --git a/lesson_15/README.md b/lesson_15/README.md index e813087bb..a48aefc01 100644 --- a/lesson_15/README.md +++ b/lesson_15/README.md @@ -14,7 +14,7 @@ Please review the following resources before lecture: ### Unit Testing -For the code in the Lesson 15 app, you will write tests in the [unit tests project][unit-tests-link]. You must achieve a code coverage of 90% or more. The coverage report can be viewed at [./tdd/tdd_app/build/reports/jacoco/test/html/index.html][coverage-report] after running `./gradlew check` or `./gradlew jacocoTestReport`. +For the code in the Lesson 15 app, you will write tests in the [unit tests project][unit-tests-link]. You must achieve a code coverage of 80% or more. The coverage report can be viewed at [./tdd/tdd_app/build/reports/jacoco/test/html/index.html][coverage-report] after running `./gradlew check` or `./gradlew jacocoTestReport`. In addition to writing unit tests, you will need to implement a new method on the `Employee` class called `getDetails` that returns a string describing the employee using the Test-Driven Development methodology. diff --git a/lesson_15/tdd/tdd_app/build.gradle.kts b/lesson_15/tdd/tdd_app/build.gradle.kts index 43d02066d..9f547bc03 100644 --- a/lesson_15/tdd/tdd_app/build.gradle.kts +++ b/lesson_15/tdd/tdd_app/build.gradle.kts @@ -49,6 +49,19 @@ tasks.jacocoTestReport { } } +tasks.jacocoTestCoverageVerification { + violationRules { + rule { + limit { + minimum = "0.8".toBigDecimal() + } + } + } +} + +tasks.check { + dependsOn(tasks.jacocoTestCoverageVerification) +} configure {