gpt4 book ai didi

java - 如何测试私有(private)静态类的私有(private)方法

转载 作者:行者123 更新时间:2023-11-29 03:09:29 25 4
gpt4 key购买 nike

<分区>

如何对私有(private)静态类中的私有(private)方法进行单元测试。

 public class ProjectModel {
//some code
private static class MyStaticClass{
private model (Object obj, Map<String , Object> model)
}
}

我试图意识到它给出了 NoSuchMethodException

Method method = projectModel.getClass().getDeclaredMethod("model", methodParameters);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com