ApplicationResetter { public List<Integer> reset(List<Integer> resetActions) { failedResetActions = new ArrayList<>(); failedResetActions.addAll(resetActions); for (int action : resetActions) { switch (action) { case ResetAction.RESET_PREFERENCES: resetPreferences(); serverRepository.clear(); break; case ResetAction.RESET_INSTANCES: resetInstances(); break; case ResetAction.RESET_FORMS: resetForms(); break; case ResetAction.RESET_LAYERS: if (deleteFolderContents(storagePathProvider.getDirPath(StorageSubdirectory.LAYERS))) { failedResetActions.remove(failedResetActions.indexOf(ResetAction.RESET_LAYERS)); } break; case ResetAction.RESET_CACHE: if (deleteFolderContents(storagePathProvider.getDirPath(StorageSubdirectory.CACHE))) { failedResetActions.remove(failedResetActions.indexOf(ResetAction.RESET_CACHE)); } break; case ResetAction.RESET_OSM_DROID: if (deleteFolderContents(Configuration.getInstance().getOsmdroidTileCache().getPath())) { failedResetActions.remove(failedResetActions.indexOf(ResetAction.RESET_OSM_DROID)); } break; } } return failedResetActions; } ApplicationResetter(); List<Integer> reset(List<Integer> resetActions);  }
@Test public void resettingPreferences_alsoResetsServers() { ApplicationResetter applicationResetter = new ApplicationResetter(); applicationResetter.reset(asList(ApplicationResetter.ResetAction.RESET_PREFERENCES)); verify(serverRepository).clear(); }