use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by signalapp.
the class FastJobStorageTest method updateJobs_writesToDatabase.
@Test
public void updateJobs_writesToDatabase() {
JobDatabase database = fixedDataDatabase(DataSet1.FULL_SPECS);
FastJobStorage subject = new FastJobStorage(database);
List<JobSpec> jobs = Collections.singletonList(new JobSpec("id1", "f1", null, 1, 1, 1, 1, 1, EMPTY_DATA, null, false, false));
subject.init();
subject.updateJobs(jobs);
verify(database).updateJobs(jobs);
}
use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by signalapp.
the class FastJobStorageTest method updateAllJobsToBePending_writesToDatabase.
@Test
public void updateAllJobsToBePending_writesToDatabase() {
JobDatabase database = noopDatabase();
FastJobStorage subject = new FastJobStorage(database);
subject.updateAllJobsToBePending();
verify(database).updateAllJobsToBePending();
}
use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by WhisperSystems.
the class FastJobStorageTest method updateJobAfterRetry_memoryOnly_doesNotWriteToDatabase.
@Test
public void updateJobAfterRetry_memoryOnly_doesNotWriteToDatabase() {
JobDatabase database = fixedDataDatabase(DataSetMemory.FULL_SPECS);
FastJobStorage subject = new FastJobStorage(database);
subject.init();
subject.updateJobAfterRetry("id1", true, 1, 10, "a");
verify(database, times(0)).updateJobAfterRetry("id1", true, 1, 10, "a");
}
use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by WhisperSystems.
the class FastJobStorageTest method updateJobs_writesToDatabase.
@Test
public void updateJobs_writesToDatabase() {
JobDatabase database = fixedDataDatabase(DataSet1.FULL_SPECS);
FastJobStorage subject = new FastJobStorage(database);
List<JobSpec> jobs = Collections.singletonList(new JobSpec("id1", "f1", null, 1, 1, 1, 1, 1, EMPTY_DATA, null, false, false));
subject.init();
subject.updateJobs(jobs);
verify(database).updateJobs(jobs);
}
use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by WhisperSystems.
the class FastJobStorageTest method updateJobs_memoryOnly_doesNotWriteToDatabase.
@Test
public void updateJobs_memoryOnly_doesNotWriteToDatabase() {
JobDatabase database = fixedDataDatabase(DataSetMemory.FULL_SPECS);
FastJobStorage subject = new FastJobStorage(database);
List<JobSpec> jobs = Collections.singletonList(new JobSpec("id1", "f1", null, 1, 1, 1, 1, 1, EMPTY_DATA, null, false, false));
subject.init();
subject.updateJobs(jobs);
verify(database, times(0)).updateJobs(jobs);
}
Aggregations