Merge pull request #14373 from ukhan1980/BAEL-6697-fail-maven-build-if-coverage-falls
[BAEL-6697] code for jacoco fail build
This commit is contained in:
+8
-2
@@ -3,7 +3,13 @@ package com.baeldung.jacocoexclusions.service;
|
||||
public class ProductService {
|
||||
private static final double DISCOUNT = 0.25;
|
||||
|
||||
public double getSalePrice(double originalPrice) {
|
||||
return originalPrice - originalPrice * DISCOUNT;
|
||||
public double getSalePrice(double originalPrice, boolean flag) {
|
||||
double discount;
|
||||
if (flag) {
|
||||
discount = originalPrice - originalPrice * DISCOUNT;
|
||||
} else {
|
||||
discount = originalPrice;
|
||||
}
|
||||
return discount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user