Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试测试包含 facesContext(与 JSF 后端 bean 相关)的方法时,我在 Junit 中遇到空指针异常。
context.getApplication().evaluateExpressionGet();
在这里,我得到了 NullpointerExeotion。
如何在 Junit 中避免此异常。
您的单元测试需要在服务器端运行。使用仙人掌你可以做到这一点。还有另一个项目 JSFUnit,但从未测试过。