@Test public void testSetCurrentConfigAsyncSuccess() throws Exception { File configFile = new File(temporaryFolder.getRoot(), "config"); ParseCurrentConfigController currentConfigController = new ParseCurrentConfigController(configFile); assertFalse(configFile.exists()); assertNull(currentConfigController.currentConfig); ParseConfig config = new ParseConfig(); ParseTaskUtils.wait(currentConfigController.setCurrentConfigAsync(config)); assertTrue(configFile.exists()); assertSame(config, currentConfigController.currentConfig); }
public Task<Void> setCurrentConfigAsync(final ParseConfig config) { return Task.call(new Callable<Void>() { @Override public Void call() { synchronized (currentConfigMutex) { currentConfig = config; saveToDisk(config); } return null; } }, ParseExecutors.io()); }
ParseCurrentConfigController { public Task<Void> setCurrentConfigAsync(final ParseConfig config) { return Task.call(new Callable<Void>() { @Override public Void call() { synchronized (currentConfigMutex) { currentConfig = config; saveToDisk(config); } return null; } }, ParseExecutors.io()); } }
ParseCurrentConfigController { public Task<Void> setCurrentConfigAsync(final ParseConfig config) { return Task.call(new Callable<Void>() { @Override public Void call() { synchronized (currentConfigMutex) { currentConfig = config; saveToDisk(config); } return null; } }, ParseExecutors.io()); } ParseCurrentConfigController(File currentConfigFile); }
ParseCurrentConfigController { public Task<Void> setCurrentConfigAsync(final ParseConfig config) { return Task.call(new Callable<Void>() { @Override public Void call() { synchronized (currentConfigMutex) { currentConfig = config; saveToDisk(config); } return null; } }, ParseExecutors.io()); } ParseCurrentConfigController(File currentConfigFile); Task<Void> setCurrentConfigAsync(final ParseConfig config); Task<ParseConfig> getCurrentConfigAsync(); }
ParseCurrentConfigController { public Task<Void> setCurrentConfigAsync(final ParseConfig config) { return Task.call(new Callable<Void>() { @Override public Void call() { synchronized (currentConfigMutex) { currentConfig = config; saveToDisk(config); } return null; } }, ParseExecutors.io()); } ParseCurrentConfigController(File currentConfigFile); Task<Void> setCurrentConfigAsync(final ParseConfig config); Task<ParseConfig> getCurrentConfigAsync();  }