mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-29 20:11:32 +02:00
Add and test GetNumProjects
This commit is contained in:
committed by
Michael Mazour
parent
4b014826d3
commit
a595acd0a6
@@ -44,9 +44,9 @@ public class BridgeTest {
|
||||
repoStore,
|
||||
dbStore,
|
||||
swapStore,
|
||||
swapJob,
|
||||
snapshotAPI,
|
||||
resourceCache,
|
||||
swapJob
|
||||
resourceCache
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,17 @@ public class SqliteDBStoreTest {
|
||||
dbStore = new SqliteDBStore(tmpFolder.newFile("dbStore.db"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNumProjects() {
|
||||
assertEquals(0, dbStore.getNumProjects());
|
||||
dbStore.setLatestVersionForProject("asdf", 1);
|
||||
assertEquals(1, dbStore.getNumProjects());
|
||||
dbStore.setLatestVersionForProject("asdf1", 2);
|
||||
assertEquals(2, dbStore.getNumProjects());
|
||||
dbStore.setLatestVersionForProject("asdf1", 3);
|
||||
assertEquals(2, dbStore.getNumProjects());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void swapTableStartsOutEmpty() {
|
||||
assertNull(dbStore.getOldestUnswappedProject());
|
||||
|
||||
@@ -31,6 +31,7 @@ public class SwapJobImplTest {
|
||||
dbStore = mock(DBStore.class);
|
||||
swapStore = mock(SwapStore.class);
|
||||
swapJob = new SwapJobImpl(
|
||||
SwapJobConfig.DEFAULT,
|
||||
lock,
|
||||
repoStore,
|
||||
dbStore,
|
||||
|
||||
Reference in New Issue
Block a user