fix tests

This commit is contained in:
Milos Kozak 2021-04-10 12:56:54 +02:00
parent 4eef2507fb
commit e4d70a7303

View file

@ -1,15 +1,12 @@
package info.nightscout.androidaps.plugins.configBuilder
import dagger.Lazy
import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.TestBase
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.PumpSync
import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP
import org.junit.Before
@ -23,22 +20,15 @@ import org.powermock.modules.junit4.PowerMockRunner
@PrepareForTest(UserEntryLogger::class)
class ConfigBuilderPluginTest : TestBase() {
@Mock lateinit var virtualPumpPlugin: Lazy<VirtualPumpPlugin>
@Mock lateinit var treatmentsPlugin: Lazy<TreatmentsPlugin>
@Mock lateinit var sp: SP
@Mock lateinit var resourceHelper: ResourceHelper
@Mock lateinit var commandQueue: CommandQueueProvider
@Mock lateinit var activePlugin: ActivePluginProvider
@Mock lateinit var uel: UserEntryLogger
@Mock lateinit var pumpSync: PumpSync
private lateinit var configBuilderPlugin: ConfigBuilderPlugin
val injector = HasAndroidInjector {
AndroidInjector {
}
}
val injector = HasAndroidInjector { AndroidInjector { } }
@Test
fun dummy() {
@ -47,6 +37,6 @@ class ConfigBuilderPluginTest : TestBase() {
@Before
fun prepareMock() {
configBuilderPlugin = ConfigBuilderPlugin(injector, aapsLogger, resourceHelper, sp, RxBusWrapper(aapsSchedulers), activePlugin, uel)
configBuilderPlugin = ConfigBuilderPlugin(injector, aapsLogger, resourceHelper, sp, RxBusWrapper(aapsSchedulers), activePlugin, uel, pumpSync)
}
}