@Test public void testGetFromDiskSuccessConfigFileNotJsonFile() throws Exception { File configFile = new File(temporaryFolder.getRoot(), "config"); ParseFileUtils.writeStringToFile(configFile, "notJson", "UTF-8"); ParseCurrentConfigController currentConfigController = new ParseCurrentConfigController(configFile); ParseConfig config = currentConfigController.getFromDisk(); assertNull(config); }
ParseConfig getFromDisk() { JSONObject json; try { json = ParseFileUtils.readFileToJSONObject(currentConfigFile); } catch (IOException | JSONException e) { return null; } return ParseConfig.decode(json, ParseDecoder.get()); }
ParseCurrentConfigController { ParseConfig getFromDisk() { JSONObject json; try { json = ParseFileUtils.readFileToJSONObject(currentConfigFile); } catch (IOException | JSONException e) { return null; } return ParseConfig.decode(json, ParseDecoder.get()); } }
ParseCurrentConfigController { ParseConfig getFromDisk() { JSONObject json; try { json = ParseFileUtils.readFileToJSONObject(currentConfigFile); } catch (IOException | JSONException e) { return null; } return ParseConfig.decode(json, ParseDecoder.get()); } ParseCurrentConfigController(File currentConfigFile); }
ParseCurrentConfigController { ParseConfig getFromDisk() { JSONObject json; try { json = ParseFileUtils.readFileToJSONObject(currentConfigFile); } catch (IOException | JSONException e) { return null; } return ParseConfig.decode(json, ParseDecoder.get()); } ParseCurrentConfigController(File currentConfigFile); Task<Void> setCurrentConfigAsync(final ParseConfig config); Task<ParseConfig> getCurrentConfigAsync(); }
ParseCurrentConfigController { ParseConfig getFromDisk() { JSONObject json; try { json = ParseFileUtils.readFileToJSONObject(currentConfigFile); } catch (IOException | JSONException e) { return null; } return ParseConfig.decode(json, ParseDecoder.get()); } ParseCurrentConfigController(File currentConfigFile); Task<Void> setCurrentConfigAsync(final ParseConfig config); Task<ParseConfig> getCurrentConfigAsync();  }