forked from jberkel/sms-backup-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persistent jobs, retry failed, skip connectivity check
- Loading branch information
Showing
5 changed files
with
44 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,7 @@ private UserNotification(String title, String text) { | |
when(authPreferences.getStoreUri()).thenReturn("imap+ssl+://xoauth:[email protected]:993"); | ||
when(authPreferences.isLoginInformationSet()).thenReturn(true); | ||
when(preferences.getBackupContactGroup()).thenReturn(ContactGroup.EVERYBODY); | ||
when(preferences.isUseOldScheduler()).thenReturn(true); | ||
} | ||
|
||
@After public void after() { | ||
|
@@ -120,6 +121,17 @@ private UserNotification(String title, String text) { | |
assertThat(service.getState().exception).isExactlyInstanceOf(NoConnectionException.class); | ||
} | ||
|
||
@Test public void shouldNotCheckForConnectivityBeforeBackingUpWithNewScheduler() throws Exception { | ||
when(preferences.isUseOldScheduler()).thenReturn(false); | ||
|
||
Intent intent = new Intent(); | ||
intent.putExtra(BackupType.EXTRA, BackupType.REGULAR.name()); | ||
shadowConnectivityManager.setActiveNetworkInfo(null); | ||
shadowConnectivityManager.setBackgroundDataSetting(true); | ||
service.handleIntent(intent); | ||
verify(backupTask).execute(any(BackupConfig.class)); | ||
} | ||
|
||
@Test public void shouldCheckForWifiConnectivity() throws Exception { | ||
Intent intent = new Intent(); | ||
when(preferences.isWifiOnly()).thenReturn(true); | ||
|