IllegalArgumentException:尝试模拟JOptionPane时的TypeMismatch

时间:2017-08-15 11:39:47

标签: swing unit-testing junit mocking joptionpane

为什么我在这里得到IllegalArgumentException:TypeMismatch

@PrepareForTest({ JOptionPane.class })
...        
PowerMockito.mockStatic(JOptionPane.class)
PowerMockito.doNothing().when(JOptionPane.class, "showMessageDialog", Component.class, Object.class);

感谢您的建议!

0 个答案:

没有答案