FileControlImpl implements FileControl { public void setCheckFileExist(boolean checkFileExist) { FileUtility.setCheckFileExist(checkFileExist); }  @Override void copyFile(String srcFile, String newFile); @Override void deleteFile(String srcFile); @Override void mergeFile(List<String> fileList, String newFile); @Override void renameFile(String srcFile, String newFile); String getBasePath(); void setBasePath(String basePath); void setCheckFileExist(boolean checkFileExist);  }
@Test public void testSetCheckFileExist01() throws Exception { FileControlImpl fileControl = new FileControlImpl(); boolean checkFileExist = true; PowerMockito.mockStatic(FileUtility.class); ArgumentCaptor<Boolean> argSetCheckFileExist = ArgumentCaptor.forClass( Boolean.class); PowerMockito.doNothing().when(FileUtility.class, "setCheckFileExist", argSetCheckFileExist.capture()); fileControl.setCheckFileExist(checkFileExist); PowerMockito.verifyStatic(); FileUtility.setCheckFileExist(Mockito.anyBoolean()); assertEquals(checkFileExist, argSetCheckFileExist.getValue()); }
@Test public void testSetCheckFileExist02() throws Exception { FileControlImpl fileControl = new FileControlImpl(); boolean checkFileExist = false; PowerMockito.mockStatic(FileUtility.class); ArgumentCaptor<Boolean> argSetCheckFileExist = ArgumentCaptor.forClass( Boolean.class); PowerMockito.doNothing().when(FileUtility.class, "setCheckFileExist", argSetCheckFileExist.capture()); fileControl.setCheckFileExist(checkFileExist); PowerMockito.verifyStatic(); FileUtility.setCheckFileExist(Mockito.anyBoolean()); assertEquals(checkFileExist, argSetCheckFileExist.getValue()); }