我想为java.i中的以下函数编写一个测试,以模拟创建数组。嘲笑使用powermock创建数组java
@Test
public void test1()
{
File f1 = createMock(File.class);
File[] files = new File[]{f1};
expectNew(File[].class).andReturn(fArray);
replayAll();
File[] res = myclass.myFunc();
verifyAll();
assertEquals(f1, res[0]);
}
它抛出具有以下消息的异常: org.powermock.reflect.exceptions.ConstructorNotFoundException: No constructor found in class java.io.file with parameter types:<none>