叮当猫咪
我的代码用于PrintWriter将内容写入文件,例如PrintWriter writer = null;try{ writer = new PrintWriter( fileName + "_version", "UTF-8" ); writer.println( "writing File" );}catch( FileNotFoundException e ){ e.printStackTrace();}我只想使用 EasyMock 编写 jUnit 测试。如何在 EasyMock 中模拟new对象创建PrintWriter?