use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by WhisperSystems.
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 noopDatabase.
private JobDatabase noopDatabase() {
JobDatabase database = mock(JobDatabase.class);
when(database.getAllJobSpecs()).thenReturn(Collections.emptyList());
when(database.getAllConstraintSpecs()).thenReturn(Collections.emptyList());
when(database.getAllDependencySpecs()).thenReturn(Collections.emptyList());
return database;
}
use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by WhisperSystems.
the class FastJobStorageTest method updateJobRunningState_writesToDatabase.
@Test
public void updateJobRunningState_writesToDatabase() {
JobDatabase database = fixedDataDatabase(DataSet1.FULL_SPECS);
FastJobStorage subject = new FastJobStorage(database);
subject.init();
subject.updateJobRunningState("id1", true);
verify(database).updateJobRunningState("id1", true);
}
use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by WhisperSystems.
the class FastJobStorageTest method fixedDataDatabase.
private JobDatabase fixedDataDatabase(List<FullSpec> fullSpecs) {
JobDatabase database = mock(JobDatabase.class);
when(database.getAllJobSpecs()).thenReturn(Stream.of(fullSpecs).map(FullSpec::getJobSpec).toList());
when(database.getAllConstraintSpecs()).thenReturn(Stream.of(fullSpecs).map(FullSpec::getConstraintSpecs).flatMap(Stream::of).toList());
when(database.getAllDependencySpecs()).thenReturn(Stream.of(fullSpecs).map(FullSpec::getDependencySpecs).flatMap(Stream::of).toList());
return database;
}
use of org.thoughtcrime.securesms.database.JobDatabase in project Signal-Android by WhisperSystems.
the class FastJobStorageTest method updateJobAfterRetry_writesToDatabase.
@Test
public void updateJobAfterRetry_writesToDatabase() {
JobDatabase database = fixedDataDatabase(DataSet1.FULL_SPECS);
FastJobStorage subject = new FastJobStorage(database);
subject.init();
subject.updateJobAfterRetry("id1", true, 1, 10, "a");
verify(database).updateJobAfterRetry("id1", true, 1, 10, "a");
}
Aggregations