Unit testing 在intellij中查看条件覆盖率

Unit testing 在intellij中查看条件覆盖率,unit-testing,intellij-idea,junit,code-coverage,jacoco,Unit Testing,Intellij Idea,Junit,Code Coverage,Jacoco,鉴于代码: public void foo(int age,boolean smart) { if (age>18 && smart) { // <--- This is the part that should be covered doSomething() } } public void foo(int-age,布尔智能){ 如果(年龄>18岁&&smart){/是。如果您正在使用IntelliJ IDEA coverage runner,您需

鉴于代码:

public void foo(int age,boolean smart) {
  if (age>18 && smart) { // <--- This is the part that should be covered
    doSomething()
  }
}
public void foo(int-age,布尔智能){

如果(年龄>18岁&&smart){/是。如果您正在使用IntelliJ IDEA coverage runner,您需要将其切换到跟踪模式。

太好了,我当时的印象是该分支已经包含在采样中。我现在必须回去检查一些100%代码覆盖的测试:D