我正在尝试将@Rule
注释与ExpectedException
一起使用>初始化变量类型ExceptedException的
ExceptedException.none()
方法表示已弃用了什么方法来初始化ExceptedException对象。示例:public ExpectedException expectedException = ExpectedException.none();
@Test
public void testThrownException() throws Exception {
expectedException.expect(CustomException.class);
expectedException.expectMessage("Exception Message");
...
}
我正在尝试将@Rule批注与ExpectedException一起使用ExceptedException.none()方法来初始化ExceptedException的变量类型,它已被弃用了……