@Test public void testPersist() throws Exception { ConfigManager testConfigManager = buildTestConfigManager(); testConfigManager.persist(); File file = new File(testConfigManager.configFilePath()); assertEquals(CONTENT_ENCODE, MixAll.file2String(file)); }
public synchronized void persist() { String jsonString = this.encode(true); if (jsonString != null) { String fileName = this.configFilePath(); try { MixAll.string2File(jsonString, fileName); } catch (IOException e) { log.error("persist file " + fileName + " exception", e); } } }
ConfigManager { public synchronized void persist() { String jsonString = this.encode(true); if (jsonString != null) { String fileName = this.configFilePath(); try { MixAll.string2File(jsonString, fileName); } catch (IOException e) { log.error("persist file " + fileName + " exception", e); } } } }
ConfigManager { public synchronized void persist() { String jsonString = this.encode(true); if (jsonString != null) { String fileName = this.configFilePath(); try { MixAll.string2File(jsonString, fileName); } catch (IOException e) { log.error("persist file " + fileName + " exception", e); } } }  }
ConfigManager { public synchronized void persist() { String jsonString = this.encode(true); if (jsonString != null) { String fileName = this.configFilePath(); try { MixAll.string2File(jsonString, fileName); } catch (IOException e) { log.error("persist file " + fileName + " exception", e); } } }  abstract String encode(); boolean load(); abstract String configFilePath(); abstract void decode(final String jsonString); synchronized void persist(); abstract String encode(final boolean prettyFormat); }
ConfigManager { public synchronized void persist() { String jsonString = this.encode(true); if (jsonString != null) { String fileName = this.configFilePath(); try { MixAll.string2File(jsonString, fileName); } catch (IOException e) { log.error("persist file " + fileName + " exception", e); } } }  abstract String encode(); boolean load(); abstract String configFilePath(); abstract void decode(final String jsonString); synchronized void persist(); abstract String encode(final boolean prettyFormat);  }