@Test public void testSave() { GithubCallbackListener cl1 = new GithubCallbackListener(); githubCallbackListeners.put("https: cl1.getOrCreateSubscription("testnetwork", "#testchannel1"); cl1.getOrCreateSubscription("testnetwork", "#testchannel2"); GithubCallbackListener cl2 = new GithubCallbackListener(); githubCallbackListeners.put("https: cl2.getOrCreateSubscription("testnetwork", "#testchannel3"); cl2.getOrCreateSubscription("testnetwork", "#testchannel4"); String desiredResult = "{\"githubCallbackListeners\":{\"https: assertEquals(desiredResult, storageManager.saveListeners(githubCallbackListeners)); }
protected String saveListeners(GithubCallbackListeners githubCallbackListeners) { Gson gson = new Gson(); final String json = gson.toJson(githubCallbackListeners); try { SimpleIO.saveConfig(database_file, new HashMap<String,String>() { { put("json", json); } }); } catch (IOException e) { logger.error("Failed to save Github listener settings.", e.getCause()); } return json; }
StorageManager { protected String saveListeners(GithubCallbackListeners githubCallbackListeners) { Gson gson = new Gson(); final String json = gson.toJson(githubCallbackListeners); try { SimpleIO.saveConfig(database_file, new HashMap<String,String>() { { put("json", json); } }); } catch (IOException e) { logger.error("Failed to save Github listener settings.", e.getCause()); } return json; } }
StorageManager { protected String saveListeners(GithubCallbackListeners githubCallbackListeners) { Gson gson = new Gson(); final String json = gson.toJson(githubCallbackListeners); try { SimpleIO.saveConfig(database_file, new HashMap<String,String>() { { put("json", json); } }); } catch (IOException e) { logger.error("Failed to save Github listener settings.", e.getCause()); } return json; } StorageManager(String database_file); }
StorageManager { protected String saveListeners(GithubCallbackListeners githubCallbackListeners) { Gson gson = new Gson(); final String json = gson.toJson(githubCallbackListeners); try { SimpleIO.saveConfig(database_file, new HashMap<String,String>() { { put("json", json); } }); } catch (IOException e) { logger.error("Failed to save Github listener settings.", e.getCause()); } return json; } StorageManager(String database_file);  }
StorageManager { protected String saveListeners(GithubCallbackListeners githubCallbackListeners) { Gson gson = new Gson(); final String json = gson.toJson(githubCallbackListeners); try { SimpleIO.saveConfig(database_file, new HashMap<String,String>() { { put("json", json); } }); } catch (IOException e) { logger.error("Failed to save Github listener settings.", e.getCause()); } return json; } StorageManager(String database_file);   }