【发布时间】:2010-07-12 10:35:46
【问题描述】:
我正在尝试模拟一个通用接口,每当我模拟它时,我都会收到以下警告:
GenericInterface 类型的表达式需要未经检查的转换才能符合 GenericInterface
我的界面是
interface GenericInterface<T>{
public T get();
}
我的测试是
@Test
public void testGenericMethod(){
GenericInterface<String> mockedInterface = EasyMock.createMock(GenericInterface.class);
}
我在测试用例的第一行收到警告。
如何删除此一般警告?
【问题讨论】: