Clean up `DependencyInjectionTest`
package com.fsck.k9
-import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import com.fsck.k9.ui.changelog.ChangeLogMode
import com.fsck.k9.ui.changelog.ChangelogViewModel
@@ -26,10 +25,10 @@ import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(application = App::class)
class DependencyInjectionTest : AutoCloseKoinTest() {
- val lifecycleOwner = mock<LifecycleOwner> {
- on { lifecycle } doReturn mock<Lifecycle>()
+ private val lifecycleOwner = mock<LifecycleOwner> {
+ on { lifecycle } doReturn mock()
}
- val autocryptTransferView = mock<AutocryptKeyTransferActivity>()
+ private val autocryptTransferView = mock<AutocryptKeyTransferActivity>()
@KoinInternalApi
@Test
@@ -38,7 +37,7 @@ class DependencyInjectionTest : AutoCloseKoinTest() {
getKoin().checkModules {
withParameter<OpenPgpApiManager> { lifecycleOwner }
- create<AutocryptKeyTransferPresenter> { parametersOf(lifecycleOwner, autocryptTransferView) }
+ withParameters<AutocryptKeyTransferPresenter> { parametersOf(lifecycleOwner, autocryptTransferView) }
withParameter<FolderNameFormatter> { RuntimeEnvironment.getApplication() }
withParameter<SizeFormatter> { RuntimeEnvironment.getApplication() }
withParameter<ChangelogViewModel> { ChangeLogMode.CHANGE_LOG }
