remove PowerMock from all modules except wear
This commit is contained in:
parent
b40428c986
commit
b2c45d0a26
192 changed files with 714 additions and 1216 deletions
|
@ -66,6 +66,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
injector: HasAndroidInjector,
|
||||
aapsLogger: AAPSLogger,
|
||||
resourceHelper: ResourceHelper,
|
||||
private val smsManager: SmsManager,
|
||||
private val aapsSchedulers: AapsSchedulers,
|
||||
private val sp: SP,
|
||||
private val constraintChecker: ConstraintChecker,
|
||||
|
@ -1090,7 +1091,6 @@ class SmsCommunicatorPlugin @Inject constructor(
|
|||
}
|
||||
|
||||
fun sendSMS(sms: Sms): Boolean {
|
||||
val smsManager = SmsManager.getDefault()
|
||||
sms.text = stripAccents(sms.text)
|
||||
try {
|
||||
aapsLogger.debug(LTag.SMS, "Sending SMS to " + sms.phoneNumber + ": " + sms.text)
|
||||
|
|
|
@ -7,7 +7,11 @@ import info.nightscout.androidaps.data.ProfileSealed
|
|||
import info.nightscout.androidaps.database.embedments.InsulinConfiguration
|
||||
import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch
|
||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||
import info.nightscout.androidaps.interfaces.*
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.ProfileStore
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
|
@ -15,10 +19,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import org.json.JSONObject
|
||||
import org.junit.Before
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@PrepareForTest(FabricPrivacy::class)
|
||||
open class TestBaseWithProfile : TestBase() {
|
||||
|
||||
@Mock lateinit var activePluginProvider: ActivePlugin
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.app.NotificationManager
|
|||
import android.content.Context
|
||||
import dagger.android.AndroidInjector
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
|
@ -17,19 +16,15 @@ import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
|||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(ConstraintChecker::class, ReceiverStatusStore::class, RunningConfiguration::class, UserEntryLogger::class, DateUtil::class)
|
||||
class LoopPluginTest : TestBase() {
|
||||
|
||||
@Mock lateinit var sp: SP
|
||||
|
|
|
@ -11,13 +11,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(UserEntryLogger::class)
|
||||
class ConfigBuilderPluginTest : TestBase() {
|
||||
|
||||
@Mock lateinit var sp: SP
|
||||
|
|
|
@ -39,31 +39,31 @@ class DstHelperPluginTest : TestBase() {
|
|||
var cal = Calendar.getInstance(tz, Locale.ITALIAN)
|
||||
val df: DateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.ITALIAN)
|
||||
var dateBeforeDST = df.parse("2018-03-25 01:55")
|
||||
cal.time = dateBeforeDST
|
||||
cal.time = dateBeforeDST!!
|
||||
Assert.assertEquals(false, plugin.wasDST(cal))
|
||||
Assert.assertEquals(true, plugin.willBeDST(cal))
|
||||
TimeZone.setDefault(tz)
|
||||
cal = Calendar.getInstance(tz, Locale.ITALIAN)
|
||||
dateBeforeDST = df.parse("2018-03-25 03:05")
|
||||
cal.time = dateBeforeDST
|
||||
cal.time = dateBeforeDST!!
|
||||
Assert.assertEquals(true, plugin.wasDST(cal))
|
||||
Assert.assertEquals(false, plugin.willBeDST(cal))
|
||||
TimeZone.setDefault(tz)
|
||||
cal = Calendar.getInstance(tz, Locale.ITALIAN)
|
||||
dateBeforeDST = df.parse("2018-03-25 02:05") //Cannot happen!!!
|
||||
cal.time = dateBeforeDST
|
||||
cal.time = dateBeforeDST!!
|
||||
Assert.assertEquals(true, plugin.wasDST(cal))
|
||||
Assert.assertEquals(false, plugin.willBeDST(cal))
|
||||
TimeZone.setDefault(tz)
|
||||
cal = Calendar.getInstance(tz, Locale.ITALIAN)
|
||||
dateBeforeDST = df.parse("2018-03-25 05:55") //Cannot happen!!!
|
||||
cal.time = dateBeforeDST
|
||||
cal.time = dateBeforeDST!!
|
||||
Assert.assertEquals(true, plugin.wasDST(cal))
|
||||
Assert.assertEquals(false, plugin.willBeDST(cal))
|
||||
TimeZone.setDefault(tz)
|
||||
cal = Calendar.getInstance(tz, Locale.ITALIAN)
|
||||
dateBeforeDST = df.parse("2018-03-25 06:05") //Cannot happen!!!
|
||||
cal.time = dateBeforeDST
|
||||
cal.time = dateBeforeDST!!
|
||||
Assert.assertEquals(false, plugin.wasDST(cal))
|
||||
Assert.assertEquals(false, plugin.willBeDST(cal))
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
@file:Suppress("SpellCheckingInspection")
|
||||
|
||||
package info.nightscout.androidaps.plugins.general.smsCommunicator
|
||||
|
||||
import android.telephony.SmsManager
|
||||
|
@ -29,9 +27,7 @@ import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin
|
|||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.queue.Callback
|
||||
import info.nightscout.androidaps.queue.CommandQueue
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.T
|
||||
import info.nightscout.androidaps.utils.XdripCalibrations
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
|
@ -40,25 +36,15 @@ import io.reactivex.Single
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.mockito.Mockito.anyLong
|
||||
import org.mockito.invocation.InvocationOnMock
|
||||
import org.powermock.api.mockito.PowerMockito
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
import java.util.*
|
||||
|
||||
// Powermock needed to mock SmsManager
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(
|
||||
ConstraintChecker::class, FabricPrivacy::class, VirtualPumpPlugin::class, XdripCalibrations::class,
|
||||
SmsManager::class, CommandQueue::class, LocalProfilePlugin::class, DateUtil::class,
|
||||
OneTimePassword::class, UserEntryLogger::class, LoopPlugin::class,
|
||||
AppRepository::class, DateUtil::class, AutosensDataStore::class)
|
||||
@Suppress("SpellCheckingInspection")
|
||||
class SmsCommunicatorPluginTest : TestBaseWithProfile() {
|
||||
|
||||
@Mock lateinit var sp: SP
|
||||
|
@ -74,6 +60,7 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
|
|||
@Mock lateinit var repository: AppRepository
|
||||
@Mock lateinit var dateUtilMocked: DateUtil
|
||||
@Mock lateinit var autosensDataStore: AutosensDataStore
|
||||
@Mock lateinit var smsManager: SmsManager
|
||||
|
||||
var injector: HasAndroidInjector = HasAndroidInjector {
|
||||
AndroidInjector {
|
||||
|
@ -103,9 +90,6 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
|
|||
`when`(iobCobCalculator.ads).thenReturn(autosensDataStore)
|
||||
`when`(autosensDataStore.lastBg()).thenReturn(reading)
|
||||
|
||||
PowerMockito.mockStatic(SmsManager::class.java)
|
||||
val smsManager = PowerMockito.mock(SmsManager::class.java)
|
||||
`when`(SmsManager.getDefault()).thenReturn(smsManager)
|
||||
`when`(sp.getString(R.string.key_smscommunicator_allowednumbers, "")).thenReturn("1234;5678")
|
||||
|
||||
`when`(
|
||||
|
@ -114,7 +98,7 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
|
|||
}))
|
||||
val glucoseStatusProvider = GlucoseStatusProvider(aapsLogger = aapsLogger, iobCobCalculator = iobCobCalculator, dateUtil = dateUtilMocked)
|
||||
|
||||
smsCommunicatorPlugin = SmsCommunicatorPlugin(injector, aapsLogger, resourceHelper, aapsSchedulers, sp, constraintChecker, rxBus, profileFunction, fabricPrivacy, activePlugin, commandQueue, loopPlugin, iobCobCalculator, xdripCalibrations, otp, ConfigImpl(), dateUtilMocked, uel, glucoseStatusProvider, repository)
|
||||
smsCommunicatorPlugin = SmsCommunicatorPlugin(injector, aapsLogger, resourceHelper, smsManager, aapsSchedulers, sp, constraintChecker, rxBus, profileFunction, fabricPrivacy, activePlugin, commandQueue, loopPlugin, iobCobCalculator, xdripCalibrations, otp, ConfigImpl(), dateUtilMocked, uel, glucoseStatusProvider, repository)
|
||||
smsCommunicatorPlugin.setPluginEnabled(PluginType.GENERAL, true)
|
||||
Mockito.doAnswer { invocation: InvocationOnMock ->
|
||||
val callback = invocation.getArgument<Callback>(1)
|
||||
|
|
|
@ -4,14 +4,15 @@ import android.telephony.SmsMessage
|
|||
import info.nightscout.androidaps.TestBase
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.powermock.api.mockito.PowerMockito
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
|
||||
class SmsTest : TestBase() {
|
||||
|
||||
@Test fun doTests() {
|
||||
val smsMessage = PowerMockito.mock(SmsMessage::class.java)
|
||||
PowerMockito.`when`(smsMessage.originatingAddress).thenReturn("aNumber")
|
||||
PowerMockito.`when`(smsMessage.messageBody).thenReturn("aBody")
|
||||
val smsMessage = Mockito.mock(SmsMessage::class.java)
|
||||
`when`(smsMessage.originatingAddress).thenReturn("aNumber")
|
||||
`when`(smsMessage.messageBody).thenReturn("aBody")
|
||||
var sms = Sms(smsMessage)
|
||||
Assert.assertEquals(sms.phoneNumber, "aNumber")
|
||||
Assert.assertEquals(sms.text, "aBody")
|
||||
|
|
|
@ -5,10 +5,7 @@ import info.nightscout.androidaps.plugins.general.tidepool.messages.DatasetReply
|
|||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class SessionTest {
|
||||
@Test
|
||||
fun populateBody() {
|
||||
|
|
|
@ -13,11 +13,8 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class AbstractSensitivityPluginTest : TestBase() {
|
||||
|
||||
@Mock lateinit var pluginDescription: PluginDescription
|
||||
|
|
|
@ -8,11 +8,8 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MM640GPluginTest : TestBase() {
|
||||
|
||||
private lateinit var mM640gPlugin: MM640gPlugin
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.source
|
||||
|
||||
import dagger.android.AndroidInjector
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class NSClientPluginTest : TestBase() {
|
||||
|
||||
private lateinit var nsClientSourcePlugin: NSClientSourcePlugin
|
||||
|
|
|
@ -4,17 +4,11 @@ import dagger.android.AndroidInjector
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
import info.nightscout.androidaps.database.AppRepository
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(FabricPrivacy::class, AppRepository::class)
|
||||
class TreatmentsPluginTest : TestBaseWithProfile() {
|
||||
|
||||
@Mock lateinit var sp: SP
|
||||
|
|
|
@ -19,11 +19,9 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
|||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.queue.commands.*
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.androidaps.utils.buildHelper.BuildHelper
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
|
@ -33,19 +31,11 @@ import io.reactivex.Single
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.mockito.Mockito.anyLong
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
import java.util.*
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(
|
||||
ConstraintChecker::class, VirtualPumpPlugin::class, ToastUtils::class, Context::class,
|
||||
FabricPrivacy::class, PrefFileListProvider::class, PowerManager::class,
|
||||
AppRepository::class)
|
||||
class CommandQueueTest : TestBaseWithProfile() {
|
||||
|
||||
@Mock lateinit var constraintChecker: ConstraintChecker
|
||||
|
|
|
@ -12,29 +12,18 @@ import info.nightscout.androidaps.interfaces.Constraint
|
|||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.LoggerUtils
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.queue.commands.Command
|
||||
import info.nightscout.androidaps.queue.commands.CommandTempBasalAbsolute
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.androidaps.utils.buildHelper.BuildHelper
|
||||
import info.nightscout.androidaps.utils.buildHelper.ConfigImpl
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(
|
||||
ConstraintChecker::class, VirtualPumpPlugin::class, ToastUtils::class, Context::class,
|
||||
FabricPrivacy::class, PrefFileListProvider::class, PowerManager::class)
|
||||
class QueueThreadTest : TestBaseWithProfile() {
|
||||
|
||||
@Mock lateinit var constraintChecker: ConstraintChecker
|
||||
|
|
|
@ -3,14 +3,8 @@ package info.nightscout.androidaps.utils
|
|||
import info.nightscout.androidaps.TestBase
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(DateUtil::class)
|
||||
class SntpClientTest : TestBase() {
|
||||
@Mock lateinit var dateUtil: DateUtil
|
||||
|
||||
|
|
|
@ -17,16 +17,11 @@ import info.nightscout.androidaps.utils.DateUtil
|
|||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.mockito.invocation.InvocationOnMock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(ConstraintChecker::class, VirtualPumpPlugin::class, DateUtil::class, AutosensDataStore::class)
|
||||
class BolusWizardTest : TestBase() {
|
||||
|
||||
private val pumpBolusStep = 0.1
|
||||
|
|
|
@ -14,11 +14,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class AutomationEventTest : TestBase() {
|
||||
|
||||
@Mock lateinit var loopPlugin: Loop
|
||||
|
@ -48,7 +45,6 @@ class AutomationEventTest : TestBase() {
|
|||
val event = AutomationEvent(injector)
|
||||
event.title = "Test"
|
||||
event.trigger = TriggerDummy(injector).instantiate(JSONObject(TriggerConnectorTest.oneItem))
|
||||
?: throw Exception()
|
||||
event.addAction(ActionLoopEnable(injector))
|
||||
|
||||
// export to json
|
||||
|
|
|
@ -8,12 +8,7 @@ import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerCon
|
|||
import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerDummy
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest
|
||||
class ComposeTriggerTest : TestBase() {
|
||||
|
||||
var injector: HasAndroidInjector = HasAndroidInjector { AndroidInjector { } }
|
||||
|
|
|
@ -19,10 +19,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import org.json.JSONObject
|
||||
import org.junit.Before
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@PrepareForTest(FabricPrivacy::class, AppRepository::class)
|
||||
open class TestBaseWithProfile : TestBase() {
|
||||
|
||||
@Mock lateinit var activePluginProvider: ActivePlugin
|
||||
|
|
|
@ -15,15 +15,10 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(RxBusWrapper::class, TimerUtil::class)
|
||||
class ActionAlarmTest : TestBase() {
|
||||
|
||||
@Mock lateinit var resourceHelper: ResourceHelper
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.general.automation.actions
|
||||
|
||||
import info.nightscout.androidaps.automation.R
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.PluginType
|
||||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import info.nightscout.androidaps.queue.Callback
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers.eq
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionLoopDisableTest : ActionsTestBase() {
|
||||
|
||||
lateinit var sut: ActionLoopDisable
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.general.automation.actions
|
||||
|
||||
import info.nightscout.androidaps.automation.R
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.PluginType
|
||||
import info.nightscout.androidaps.queue.Callback
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionLoopEnableTest : ActionsTestBase() {
|
||||
|
||||
lateinit var sut: ActionLoopEnable
|
||||
|
|
|
@ -6,13 +6,10 @@ import info.nightscout.androidaps.queue.Callback
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionLoopSuspendTest : ActionsTestBase() {
|
||||
|
||||
lateinit var sut: ActionLoopSuspend
|
||||
|
|
|
@ -7,12 +7,9 @@ import info.nightscout.androidaps.queue.Callback
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionProfileSwitchPercentTest : ActionsTestBase() {
|
||||
|
||||
private lateinit var sut: ActionProfileSwitchPercent
|
||||
|
|
|
@ -6,16 +6,13 @@ import info.nightscout.androidaps.queue.Callback
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.ArgumentMatchers.anyLong
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.mockito.Mockito.anyInt
|
||||
import org.mockito.Mockito.anyString
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionProfileSwitchTest : ActionsTestBase() {
|
||||
|
||||
private lateinit var sut: ActionProfileSwitch
|
||||
|
|
|
@ -6,13 +6,10 @@ import info.nightscout.androidaps.queue.Callback
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers.anyString
|
||||
import org.mockito.ArgumentMatchers.eq
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionSendSMSTest : ActionsTestBase() {
|
||||
|
||||
private lateinit var sut: ActionSendSMS
|
||||
|
|
|
@ -12,12 +12,9 @@ import io.reactivex.Single
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionStartTempTargetTest : ActionsTestBase() {
|
||||
|
||||
private lateinit var sut: ActionStartTempTarget
|
||||
|
|
|
@ -9,12 +9,9 @@ import io.reactivex.Single
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class ActionStopTempTargetTest : ActionsTestBase() {
|
||||
|
||||
private lateinit var sut: ActionStopTempTarget
|
||||
|
|
|
@ -3,12 +3,7 @@ package info.nightscout.androidaps.plugins.general.automation.actions
|
|||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest
|
||||
class ActionTest : ActionsTestBase() {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -9,7 +9,6 @@ import info.nightscout.androidaps.database.entities.OfflineEvent
|
|||
import info.nightscout.androidaps.interfaces.*
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.plugins.general.automation.TestBaseWithProfile
|
||||
import info.nightscout.androidaps.plugins.general.automation.triggers.Trigger
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
|
@ -17,9 +16,7 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.junit.Before
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
|
||||
@PrepareForTest(RxBusWrapper::class, ActionsTestBase.TestLoopPlugin::class, UserEntryLogger::class)
|
||||
open class ActionsTestBase : TestBaseWithProfile() {
|
||||
|
||||
open class TestLoopPlugin(
|
||||
|
@ -36,7 +33,7 @@ open class ActionsTestBase : TestBaseWithProfile() {
|
|||
override val isSuspended: Boolean = suspended
|
||||
override var enabled: Boolean
|
||||
get() = true
|
||||
set(value) {}
|
||||
set(_) {}
|
||||
|
||||
override fun minutesToEndOfSuspend(): Int = 0
|
||||
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.general.automation.elements
|
|||
import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerTestBase
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class InputProfileNameTest : TriggerTestBase() {
|
||||
|
||||
@Test fun setValue() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.general.automation.elements
|
|||
import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerTestBase
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class LabelWithElementTest : TriggerTestBase() {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -5,10 +5,7 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.TestBase
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class LayoutBuilderTest : TestBase() {
|
||||
|
||||
val injector = HasAndroidInjector { AndroidInjector { } }
|
||||
|
|
|
@ -5,11 +5,8 @@ import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerDum
|
|||
import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerTestBase
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class StaticLabelTest : TriggerTestBase() {
|
||||
|
||||
@Test fun constructor() {
|
||||
|
|
|
@ -4,20 +4,14 @@ import com.google.common.base.Optional
|
|||
import info.nightscout.androidaps.automation.R
|
||||
import info.nightscout.androidaps.plugins.general.automation.elements.Comparator
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(DateUtil::class)
|
||||
class TriggerAutosensValueTest : TriggerTestBase() {
|
||||
|
||||
var now = 1514766900000L
|
||||
|
|
|
@ -6,11 +6,8 @@ import info.nightscout.androidaps.plugins.general.automation.elements.Comparator
|
|||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class TriggerBTDeviceTest : TriggerTestBase() {
|
||||
|
||||
var now = 1514766900000L
|
||||
|
|
|
@ -4,10 +4,7 @@ import org.json.JSONException
|
|||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class TriggerConnectorTest : TriggerTestBase() {
|
||||
|
||||
@Test fun testTriggerList() {
|
||||
|
|
|
@ -4,19 +4,13 @@ import com.google.common.base.Optional
|
|||
import info.nightscout.androidaps.automation.R
|
||||
import info.nightscout.androidaps.data.IobTotal
|
||||
import info.nightscout.androidaps.plugins.general.automation.elements.Comparator
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(DateUtil::class)
|
||||
class TriggerIobTest : TriggerTestBase() {
|
||||
|
||||
var now = 1514766900000L
|
||||
|
|
|
@ -2,20 +2,14 @@ package info.nightscout.androidaps.plugins.general.automation.triggers
|
|||
|
||||
import com.google.common.base.Optional
|
||||
import info.nightscout.androidaps.automation.R
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.T
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(DateUtil::class)
|
||||
class TriggerTimeTest : TriggerTestBase() {
|
||||
|
||||
var now = 1514766900000L
|
||||
|
|
|
@ -21,16 +21,15 @@ buildscript {
|
|||
preferencektx_version = '1.1.1'
|
||||
commonslang3_version = '3.11'
|
||||
commonscodec_version = '1.15'
|
||||
jodatime_version = '2.10.10'
|
||||
jodatime_version = '2.10.11'
|
||||
work_version = '2.5.0'
|
||||
|
||||
junit_version = '4.13.2'
|
||||
mockitoVersion = '3.12.4'
|
||||
powermockVersion = '2.0.9'
|
||||
dexmakerVersion = "1.2"
|
||||
retrofit2Version = '2.9.0'
|
||||
okhttp3Version = '4.9.0'
|
||||
byteBuddyVersion = '1.11.16'
|
||||
byteBuddyVersion = '1.11.18'
|
||||
|
||||
androidx_junit = '1.1.2'
|
||||
androidx_rules = '1.4.0-alpha04'
|
||||
|
|
|
@ -15,14 +15,9 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(Context::class)
|
||||
class ComboPluginTest : TestBase() {
|
||||
|
||||
@Mock lateinit var resourceHelper: ResourceHelper
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.androidaps.di
|
||||
|
||||
import android.content.Context
|
||||
import android.telephony.SmsManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
@ -32,4 +33,7 @@ open class CoreModule {
|
|||
@Singleton
|
||||
fun provideAAPSLogger(l: L): AAPSLogger = AAPSLoggerProduction(l)
|
||||
|
||||
@Provides
|
||||
fun smsManager() : SmsManager = SmsManager.getDefault()
|
||||
|
||||
}
|
|
@ -17,10 +17,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import org.json.JSONObject
|
||||
import org.junit.Before
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@PrepareForTest(FabricPrivacy::class)
|
||||
open class TestBaseWithProfile : TestBase() {
|
||||
|
||||
@Mock lateinit var activePluginProvider: ActivePlugin
|
||||
|
|
|
@ -2,19 +2,13 @@ package info.nightscout.androidaps.data
|
|||
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
/**
|
||||
* Created by mike on 19.03.2018.
|
||||
*/
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(SP::class)
|
||||
class ConstraintTest : TestBase() {
|
||||
|
||||
@Test fun doTests() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.data
|
|||
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class IobTest {
|
||||
|
||||
@Test fun plusTest() {
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package info.nightscout.androidaps.data
|
||||
|
||||
import android.content.Context
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class IobTotalTest {
|
||||
class IobTotalTest : TestBase() {
|
||||
|
||||
@Mock lateinit var context: Context
|
||||
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.data
|
|||
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MealDataTest {
|
||||
|
||||
@Test fun canCreateObject() {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package info.nightscout.androidaps.data
|
||||
|
||||
import android.text.Html
|
||||
import dagger.android.AndroidInjector
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
|
@ -9,14 +8,9 @@ import org.json.JSONObject
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
import org.skyscreamer.jsonassert.JSONAssert
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(Html::class)
|
||||
class PumpEnactResultTest : TestBaseWithProfile() {
|
||||
|
||||
val injector = HasAndroidInjector {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.interfaces
|
|||
import androidx.fragment.app.Fragment
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class PluginDescriptionTest {
|
||||
|
||||
@Test fun mainTypeTest() {
|
||||
|
|
|
@ -14,15 +14,10 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(ConstraintChecker::class)
|
||||
class APSResultTest : TestBaseWithProfile() {
|
||||
|
||||
@Mock lateinit var constraintChecker: ConstraintChecker
|
||||
|
|
|
@ -5,15 +5,10 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
import java.io.File
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(File::class, UserEntryPresentationHelper::class)
|
||||
class ClassicPrefsFormatTest : TestBase() {
|
||||
|
||||
@Mock lateinit var resourceHelper: ResourceHelper
|
||||
|
|
|
@ -9,19 +9,12 @@ import org.junit.Assert
|
|||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.powermock.core.classloader.annotations.PowerMockIgnore
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
import java.io.File
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@PowerMockIgnore("javax.crypto.*")
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(File::class)
|
||||
class EncryptedPrefsFormatTest : TestBase() {
|
||||
|
||||
@Mock lateinit var resourceHelper: ResourceHelper
|
||||
|
|
|
@ -6,9 +6,6 @@ import org.hamcrest.CoreMatchers.not
|
|||
import org.junit.Assert
|
||||
import org.junit.Assume.assumeThat
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.core.classloader.annotations.PowerMockIgnore
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
// https://stackoverflow.com/questions/52344522/joseexception-couldnt-create-aes-gcm-nopadding-cipher-illegal-key-size
|
||||
// https://stackoverflow.com/questions/47708951/can-aes-256-work-on-android-devices-with-api-level-26
|
||||
|
@ -21,8 +18,6 @@ fun assumeAES256isSupported(cryptoUtil: CryptoUtil) {
|
|||
}
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@PowerMockIgnore("javax.crypto.*")
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class CryptoUtilTest : TestBase() {
|
||||
|
||||
private var cryptoUtil: CryptoUtil = CryptoUtil(aapsLogger)
|
||||
|
|
|
@ -6,13 +6,10 @@ import info.nightscout.androidaps.core.R
|
|||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
import java.util.*
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class DateUtilTest : TestBase() {
|
||||
|
||||
@Mock lateinit var context: Context
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.utils
|
|||
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class DecimalFormatterTest {
|
||||
|
||||
@Test fun to0DecimalTest() {
|
||||
|
|
|
@ -3,11 +3,8 @@ package info.nightscout.androidaps.utils
|
|||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class JsonHelperTest {
|
||||
|
||||
private val jsonString = "{\"d\":\"3.0\",\"i\":\"4\",\"s\":\"5\",\"b\":\"true\",\"j\":{\"a\": \"1\"}}"
|
||||
|
|
|
@ -4,7 +4,11 @@ import dagger.android.AndroidInjector
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.data.ProfileSealed
|
||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||
import info.nightscout.androidaps.interfaces.*
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.ProfileStore
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
|
@ -13,10 +17,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import org.json.JSONObject
|
||||
import org.junit.Before
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@PrepareForTest(FabricPrivacy::class)
|
||||
open class TestBaseWithProfile : TestBase() {
|
||||
|
||||
@Mock lateinit var activePluginProvider: ActivePlugin
|
||||
|
|
|
@ -5,11 +5,8 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class DanaPumpTest : TestBaseWithProfile() {
|
||||
|
||||
@Mock lateinit var sp: SP
|
||||
|
|
|
@ -4,7 +4,11 @@ import dagger.android.AndroidInjector
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.data.ProfileSealed
|
||||
import info.nightscout.androidaps.extensions.pureProfileFromJson
|
||||
import info.nightscout.androidaps.interfaces.*
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.Config
|
||||
import info.nightscout.androidaps.interfaces.Profile
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.ProfileStore
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
|
@ -13,10 +17,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper
|
|||
import org.json.JSONObject
|
||||
import org.junit.Before
|
||||
import org.mockito.Mock
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
@PrepareForTest(FabricPrivacy::class)
|
||||
open class TestBaseWithProfile : TestBase() {
|
||||
|
||||
@Mock lateinit var activePluginProvider: ActivePlugin
|
||||
|
|
|
@ -17,14 +17,9 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(SP::class, ConstraintChecker::class)
|
||||
class DanaRPluginTest : TestBaseWithProfile() {
|
||||
|
||||
@Mock lateinit var context: Context
|
||||
|
|
|
@ -27,9 +27,7 @@ import org.mockito.Mock
|
|||
import org.mockito.Mockito.`when`
|
||||
import org.mockito.Mockito.anyBoolean
|
||||
import org.mockito.Mockito.doNothing
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
|
||||
@PrepareForTest(DetailedBolusInfoStorage::class, ConstraintChecker::class, DanaRKoreanPlugin::class, DanaRPlugin::class)
|
||||
open class DanaRTestBase : TestBase() {
|
||||
|
||||
@Mock lateinit var sp: SP
|
||||
|
|
|
@ -4,11 +4,8 @@ import info.nightscout.androidaps.danar.comm.MessageHashTableR
|
|||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MessageHashTableRTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -5,12 +5,9 @@ import info.nightscout.androidaps.danar.comm.MsgBolusProgress
|
|||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgBolusProgressTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,16 +2,10 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgBolusStart
|
||||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(ConstraintChecker::class)
|
||||
class MsgBolusStartTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,16 +2,10 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgBolusStartWithSpeed
|
||||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(ConstraintChecker::class)
|
||||
class MsgBolusStartWithSpeedTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -5,11 +5,8 @@ import info.nightscout.androidaps.danar.comm.MsgBolusStop
|
|||
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgBolusStopTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -4,10 +4,7 @@ import info.nightscout.androidaps.dana.DanaPump
|
|||
import info.nightscout.androidaps.danar.comm.MsgCheckValue
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgCheckValueTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgError
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgErrorTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryAlarm
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryAlarmTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgHistoryAllDone
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryAllDoneTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgHistoryAll
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryAllTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryBasalHour
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryBasalHourTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryBolus
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryBolusTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryCarbo
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryCarboTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryDailyInsulin
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryDailyInsulinTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryDone
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryDoneTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryError
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryErrorTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryGlucose
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryGlucoseTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryNewDone
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryNewDoneTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryNew
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryNewTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistoryRefill
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistoryRefillTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgHistorySuspend
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgHistorySuspendTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgInitConnStatusBasic
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgInitConnStatusBasicTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgInitConnStatusBolus
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgInitConnStatusBolusTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgInitConnStatusOption
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgInitConnStatusOptionTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgInitConnStatusTime
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgInitConnStatusTimeTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgPCCommStart
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgPCCommStartTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgPCCommStop
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgPCCommStopTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetActivateBasalProfile
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetActivateBasalProfileTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetBasalProfile
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetBasalProfileTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetCarbsEntry
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetCarbsEntryTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,16 +2,10 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgSetExtendedBolusStart
|
||||
import info.nightscout.androidaps.interfaces.Constraint
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(ConstraintChecker::class)
|
||||
class MsgSetExtendedBolusStartTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetExtendedBolusStop
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetExtendedBolusStopTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetSingleBasalProfile
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetSingleBasalProfileTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetTempBasalStart
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetTempBasalStartTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetTime
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetTimeTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSetUserOptions
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSetUserOptionsTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -3,10 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
import info.nightscout.androidaps.danar.comm.MsgSettingActiveProfile
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSettingActiveProfileTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -2,10 +2,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm
|
|||
|
||||
import info.nightscout.androidaps.danar.comm.MsgSettingBasalProfileAll
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
class MsgSettingBasalProfileAllTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
|
@ -4,13 +4,8 @@ import info.nightscout.androidaps.danar.comm.MsgSettingBasal
|
|||
import info.nightscout.androidaps.interfaces.PumpDescription
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(info.nightscout.androidaps.danar.DanaRPlugin::class)
|
||||
class MsgSettingBasalTest : DanaRTestBase() {
|
||||
|
||||
@Test fun runTest() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue