From a00c459fae6c37756889292984827bb8c9fcf6fd Mon Sep 17 00:00:00 2001 From: Quentin Date: Wed, 18 Sep 2024 20:20:15 +0200 Subject: [PATCH] Jacoco coverrage Threshold rouding error --- pom.xml | 12 +++++------ .../jacoco/domain/JacocoModuleFactory.java | 20 +++++++++---------- .../features/server/javatool/jacoco.feature | 2 +- .../domain/JacocoModuleFactoryTest.java | 20 +++++++++---------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index 49f6b6e748b..6d78686ff26 100644 --- a/pom.xml +++ b/pom.xml @@ -1292,14 +1292,14 @@ CLASS - LINE - COVEREDRATIO - 1.00 + BRANCH + MISSEDCOUNT + 0 - BRANCH - COVEREDRATIO - 1.00 + LINE + MISSEDCOUNT + 0 diff --git a/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactory.java index 23966ae3a75..39d80f3767b 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactory.java @@ -88,14 +88,14 @@ private static MavenPlugin mavenJacocoWithMinCoverageCheckPluginManagement() { CLASS - LINE - COVEREDRATIO - 1.00 + BRANCH + MISSEDCOUNT + 0 - BRANCH - COVEREDRATIO - 1.00 + LINE + MISSEDCOUNT + 0 @@ -199,14 +199,14 @@ private static GradleMainBuildPlugin gradleJacocoWithMinCoverageCheckPlugin() { limit { counter = "LINE" - value = "COVEREDRATIO" - minimum = "1.00".toBigDecimal() + value = "MISSEDCOUNT" + maximum = "0.00".toBigDecimal() } limit { counter = "BRANCH" - value = "COVEREDRATIO" - minimum = "1.00".toBigDecimal() + value = "MISSEDCOUNT" + maximum = "0.00".toBigDecimal() } } } diff --git a/src/test/features/server/javatool/jacoco.feature b/src/test/features/server/javatool/jacoco.feature index 9b8d0feedea..3c1a1e5b06f 100644 --- a/src/test/features/server/javatool/jacoco.feature +++ b/src/test/features/server/javatool/jacoco.feature @@ -6,4 +6,4 @@ Feature: Jacoco module Scenario: Should apply jacoco with min coverage check module When I apply "jacoco-with-min-coverage-check" module to default project with maven file without parameters - Then I should have "COVEREDRATIO" in "pom.xml" + Then I should have "MISSEDCOUNT" in "pom.xml" diff --git a/src/test/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactoryTest.java index 403695f632f..5b550f5736d 100644 --- a/src/test/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/server/javatool/jacoco/domain/JacocoModuleFactoryTest.java @@ -124,14 +124,14 @@ void shouldBuildJacocoWithMinCoverageCheckModule() { CLASS - LINE - COVEREDRATIO - 1.00 + BRANCH + MISSEDCOUNT + 0 - BRANCH - COVEREDRATIO - 1.00 + LINE + MISSEDCOUNT + 0 @@ -228,14 +228,14 @@ void shouldBuildJacocoWithMinCoverageCheckModule() { limit { counter = "LINE" - value = "COVEREDRATIO" - minimum = "1.00".toBigDecimal() + value = "MISSEDCOUNT" + maximum = "0.00".toBigDecimal() } limit { counter = "BRANCH" - value = "COVEREDRATIO" - minimum = "1.00".toBigDecimal() + value = "MISSEDCOUNT" + maximum = "0.00".toBigDecimal() } } }