我想ContentIOException从一个签名看起来像这样的方法中抛出一个.
public void putContent(InputStream is) throws ContentIOException.
Run Code Online (Sandbox Code Playgroud)
当我试图ContentIOException从Mockito那样抛出时:
when(StubbedObject.putContent(contentStream)).thenThrow(ContentIOException.class);
Run Code Online (Sandbox Code Playgroud)
我收到以下编译错误:
The method when(T) in the type Mockito is not applicable for the arguments (void).
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?