mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-28 05:35:44 +00:00
Decrypt and process messages all in one transaction.
Giddy up
This commit is contained in:
@@ -26,6 +26,7 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.thoughtcrime.securesms.testutil.TestHelpers.setOf;
|
||||
|
||||
public class FastJobStorageTest {
|
||||
|
||||
@@ -557,6 +558,35 @@ public class FastJobStorageTest {
|
||||
assertEquals(0, subject.getJobCountForFactoryAndQueue("f1", "does-not-exist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void areQueuesEmpty_allNonEmpty() {
|
||||
FastJobStorage subject = new FastJobStorage(fixedDataDatabase(DataSet1.FULL_SPECS));
|
||||
|
||||
subject.init();
|
||||
|
||||
assertFalse(subject.areQueuesEmpty(setOf("q1")));
|
||||
assertFalse(subject.areQueuesEmpty(setOf("q1", "q2")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void areQueuesEmpty_mixedEmpty() {
|
||||
FastJobStorage subject = new FastJobStorage(fixedDataDatabase(DataSet1.FULL_SPECS));
|
||||
|
||||
subject.init();
|
||||
|
||||
assertFalse(subject.areQueuesEmpty(setOf("q1", "q5")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void areQueuesEmpty_queueDoesNotExist() {
|
||||
FastJobStorage subject = new FastJobStorage(fixedDataDatabase(DataSet1.FULL_SPECS));
|
||||
|
||||
subject.init();
|
||||
|
||||
assertTrue(subject.areQueuesEmpty(setOf("q4")));
|
||||
assertTrue(subject.areQueuesEmpty(setOf("q4", "q5")));
|
||||
}
|
||||
|
||||
private JobDatabase noopDatabase() {
|
||||
JobDatabase database = mock(JobDatabase.class);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user