Add test coverage plugin to see the code coverage

This commit is contained in:
2020-03-21 23:36:21 +11:00
parent 231e8d5bb0
commit 6f987fbeb9
3 changed files with 20 additions and 6 deletions
+14 -1
View File
@@ -1,5 +1,6 @@
plugins {
id 'java'
id 'jacoco'
}
group 'com.github.wahyd4'
@@ -12,5 +13,17 @@ repositories {
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
// testCompile group: 'junit', name: 'junit', version: '4.12'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
+3 -2
View File
@@ -1,5 +1,6 @@
#Sat Mar 21 23:13:59 AEDT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
@@ -1,12 +1,12 @@
package com.github.wahyd4.creditcard.service;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class FraudCheckerTest {