### Question:
EagleEyeLogUtil { public static void log(String resource, String exceptionName, String ruleLimitApp, String origin, int count) { statLogger.stat(resource, exceptionName, ruleLimitApp, origin).count(count); }  static void log(String resource, String exceptionName, String ruleLimitApp, String origin, int count); static final String FILE_NAME; }### Answer:
@Test public void testWriteLog() throws Exception { EagleEyeLogUtil.log("resourceName", "BlockException", "app1", "origin", 1); final File file = new File(LogBase.getLogBaseDir() + EagleEyeLogUtil.FILE_NAME); await().timeout(2, TimeUnit.SECONDS) .until(new Callable<File>() { @Override public File call() throws Exception { return file; } }, FileMatchers.anExistingFile()); }
@Test public void testWriteLog() throws Exception { EagleEyeLogUtil.log("resourceName", "BlockException", "app1", "origin", 1); final File file = new File(RecordLog.getLogBaseDir() + EagleEyeLogUtil.FILE_NAME); await().timeout(2, TimeUnit.SECONDS) .until(new Callable<File>() { @Override public File call() throws Exception { return file; } }, FileMatchers.anExistingFile()); }
@Test public void testChangeLogBase() throws Exception { String userHome = System.getProperty("user.home"); String newLogBase = userHome + File.separator + "tmpLogDir" + System.currentTimeMillis(); System.setProperty(LogBase.LOG_DIR, newLogBase); EagleEyeLogUtil.log("resourceName", "BlockException", "app1", "origin", 1); final File file = new File(RecordLog.getLogBaseDir() + EagleEyeLogUtil.FILE_NAME); await().timeout(2, TimeUnit.SECONDS) .until(new Callable<File>() { @Override public File call() throws Exception { return file; } }, FileMatchers.anExistingFile()); }