Intellij IDEA私有构造函数测试范围

时间:2020-10-09 10:09:41

标签: java intellij-idea junit integration-testing lombok

这是我的实用程序类

public class LocationMapper {

@ lombok.experimental.UtilityClass批注创建私有构造函数

当我进行测试时,总是只覆盖75%的代码。剩下的25%是此行

IntelliJ IDEA 2020.2.3 (Community Edition)
Build #IC-202.7660.26, built on October 6, 2020
Runtime version: 11.0.8+10-b944.34 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1998M
Cores: 4
Non-Bundled Plugins: Lombook Plugin, com.markskelton.one-dark-theme, org.sonarlint.idea, org.jetbrains.kotlin

我认为是因为代码无法访问,但Intellij应该在覆盖范围内忽略私有构造函数

enter image description here

这是我的IDE中的错误还是我做错了什么?

input=[ {key:"name", value:"John"}, {key:"city", value:"Chicago"}]

output = input.map( e => **magic here** );
>> output = [ {name:"John"}, {city:"Chicago"}] 

0 个答案:

没有答案