Code Coverage with SonarQube and Jacoco (#10674)
* Code Coverage with SonarQube and Jacoco * SonarQube and Jacoco * Delete SonarQube and Jacoco From the Root directory * SonarQube and JaCoCo * SonarQube And JaCoCo * BAEL-4636 : Code Coverage with SonarQube and Jacoco * Shifted to testing-modules/testing-libraries-2 * Removing this project to make a single project * Code Coverage with SonarQube and Jacoco * Formatting in pom.xml file * Delete Directory * Delete unused directory * SonarQube And JaCoCo * SonarQube And JaCoCo
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
package com.baeldung.sonarqubeandjacoco.product;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.baeldung.sonarqubeandjacoco.product.Product;
|
||||
|
||||
public class ProductUnitTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
Product product = new Product();
|
||||
product.setId(1);
|
||||
assertNull(product.getName());
|
||||
assert (product.getId() == 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProduct() {
|
||||
Product product = new Product(1, "product", 1, 2.0);
|
||||
assertNotNull(product.getName());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user