Fix failing tests, fix typo

Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
This commit is contained in:
Jonas Mayer 2023-12-20 10:00:29 +01:00 committed by Jonas Mayer
parent bbecd6e2bc
commit 979a13cbb6
3 changed files with 6 additions and 3 deletions

View file

@ -104,7 +104,7 @@ class BackgroundJobManagerTest {
clock = mock()
whenever(clock.currentTime).thenReturn(TIMESTAMP)
whenever(clock.currentDate).thenReturn(Date(TIMESTAMP))
backgroundJobManager = BackgroundJobManagerImpl(workManager, clock)
backgroundJobManager = BackgroundJobManagerImpl(workManager, clock, mock())
}
fun assertHasRequiredTags(tags: Set<String>, jobName: String, user: User? = null) {

View file

@ -25,6 +25,7 @@ import android.Manifest
import androidx.test.rule.GrantPermissionRule
import androidx.work.WorkManager
import com.nextcloud.client.core.ClockImpl
import com.nextcloud.client.preferences.AppPreferencesImpl
import com.nextcloud.test.RetryTestRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.AbstractOnServerIT
@ -43,7 +44,9 @@ import java.io.FileInputStream
class ContactsBackupIT : AbstractOnServerIT() {
val workmanager = WorkManager.getInstance(targetContext)
private val backgroundJobManager = BackgroundJobManagerImpl(workmanager, ClockImpl())
val preferences = AppPreferencesImpl.fromContext(targetContext)
private val backgroundJobManager = BackgroundJobManagerImpl(workmanager, ClockImpl(), preferences)
@get:Rule
val writeContactsRule = GrantPermissionRule.grant(Manifest.permission.WRITE_CONTACTS)

View file

@ -137,7 +137,7 @@ class EtmBackgroundJobsFragment : EtmBaseFragment(), Injectable {
"${logsForThisWorker.filter { it.started != null }.size} " +
"(${logsForThisWorker.filter { it.finished != null }.size})"
var logText = "Worker Logs\n\n" +
"*** Does NOT differentiate between imitate or periodic kinds of Work! ***\n" +
"*** Does NOT differentiate between immediate or periodic kinds of Work! ***\n" +
"*** Times run in 48h: Times started (Times finished) ***\n"
logsForThisWorker.forEach {
logText += "----------------------\n"