Java Intellij IDEA私有构造函数测试覆盖率
这是我的实用课Java Intellij IDEA私有构造函数测试覆盖率,java,intellij-idea,junit,integration-testing,lombok,Java,Intellij Idea,Junit,Integration Testing,Lombok,这是我的实用课 @UtilityClass public class LocationMapper { private static final ModelMapper MAPPER = new ModelMapper(); public LocationDTO toDTO(Location location) { return MAPPER.map(location, LocationDTO.class); } public Locatio
@UtilityClass
public class LocationMapper {
private static final ModelMapper MAPPER = new ModelMapper();
public LocationDTO toDTO(Location location) {
return MAPPER.map(location, LocationDTO.class);
}
public Location toLocation(LocationDTO locationDTO) {
return MAPPER.map(locationDTO, Location.class);
}
}
@lombok.experimental.UtilityClass注释创建私有构造函数
当我做测试时,总是只覆盖75%的代码。剩下的25%是这条线
public class LocationMapper {
我认为这是因为一个不可访问的代码,但是Intellij应该在覆盖率方面忽略私有构造函数
这是我的IDE中的一个bug还是我做错了什么
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