Complete the code to set the minimum line coverage threshold to 80%.
@Rule
public final TestRule coverage = new CoverageRule().withLineThreshold([1]);The method withLineThreshold sets the minimum line coverage percentage. Here, 80 means 80% coverage is required.
Complete the code to fail the test if branch coverage is below 85%.
@Rule
public final TestRule coverage = new CoverageRule().withBranchThreshold([1]);The withBranchThreshold method sets the minimum branch coverage percentage. 85 means the test fails if branch coverage is below 85%.
Fix the error in the code to correctly set the coverage threshold to 75%.
@Rule
public final TestRule coverage = new CoverageRule().withLineThreshold([1]);The threshold value must be an integer representing the percentage without quotes or decimals. So 75 is correct.
Fill both blanks to set line coverage to 80% and branch coverage to 70%.
@Rule
public final TestRule coverage = new CoverageRule()
.withLineThreshold([1])
.withBranchThreshold([2]);The first blank sets line coverage threshold to 80%, the second sets branch coverage threshold to 70%.
Fill all three blanks to set line coverage to 85%, branch coverage to 80%, and fail on uncovered methods.
@Rule
public final TestRule coverage = new CoverageRule()
.withLineThreshold([1])
.withBranchThreshold([2])
.failOnUncoveredMethods([3]);Set line coverage to 85 (D), branch coverage to 80 (C), and enable fail on uncovered methods with true (A).