私はMockitoの初心者です。Oracle ADF で記述されたこのコードを模倣しようとしています。
else {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
"No Cases found in Queue",null));
}
そして、これは私のモックです:
FacesMessage facesMessageMock = mock(FacesMessage.class);
PowerMockito.mockStatic(FacesContext.class);
PowerMockito.when(FacesContext.getCurrentInstance()).thenReturn(facesContextMock);
しかし、私はこのエラーがあります:
org.mockito.exceptions.misusing.MissingMethodInvocationException:
when() requires an argument which has to be 'a method call on a mock'.
私を手伝ってくれますか?