我曾经使用过joinfaces v3。但是我遇到了关于viewScoped beans的测试问题。
在documentation中,我看到Jsf spring Boot Starter自动配置了ViewScoped注释的等效Spring作用域
但是,当我尝试使用以下注释之一@Scope("view") @ViewScoped测试@Component时
在下面的代码行中,我总是在类org.joinfaces.autoconfigure.integration.ViewScope上得到一个nullPointer
FacesContext.getCurrentInstance().getViewRoot().getViewMap()因为FacesContext.getCurrentInstance为null
我们有没有关于如何测试这种bean的例子呢?谢谢
发布于 2018-02-22 06:46:03
在Joinfaces文档中有一个关于如何测试一些jsf bean的示例。也许对某些人很有用
发布于 2018-04-05 19:47:59
JoinFaces Bean测试库可能就是您正在寻找的。请参阅讨论here.
另一种可能是使用joinfaces test mock classes.
https://stackoverflow.com/questions/48797405
复制相似问题