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:
davidmartinezbarua
2023-07-24 19:16:29 -03:00
committed by GitHub
3 changed files with 44 additions and 5 deletions
@@ -9,7 +9,14 @@ class ProductServiceUnitTest {
@Test
public void givenOriginalPrice_whenGetSalePrice_thenReturnsDiscountedPrice() {
ProductService productService = new ProductService();
double salePrice = productService.getSalePrice(100);
double salePrice = productService.getSalePrice(100, true);
assertEquals(salePrice, 75);
}
@Test
public void givenOriginalPrice_whenGetSalePriceWithFlagFalse_thenReturnsDiscountedPrice() {
ProductService productService = new ProductService();
double salePrice = productService.getSalePrice(100, false);
assertEquals(salePrice, 100);
}
}