LoopPluginTest without powermock

This commit is contained in:
Milos Kozak 2021-03-21 14:05:05 +01:00
parent ed30e2bf10
commit 8ec991c3d7
6 changed files with 5 additions and 12 deletions

View file

@ -40,7 +40,7 @@ import javax.inject.Singleton
import kotlin.math.min
@Singleton
class VirtualPumpPlugin @Inject constructor(
open class VirtualPumpPlugin @Inject constructor(
injector: HasAndroidInjector,
aapsLogger: AAPSLogger,
private val rxBus: RxBusWrapper,

View file

@ -27,16 +27,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(
ConstraintChecker::class, VirtualPumpPlugin::class, FabricPrivacy::class, ReceiverStatusStore::class,
IobCobCalculatorPlugin::class, AppRepository::class)
class LoopPluginTest : TestBase() {
@Mock lateinit var sp: SP

View file

@ -10,7 +10,7 @@ import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class ConstraintChecker @Inject constructor(private val activePlugin: ActivePluginProvider) : ConstraintsInterface {
open class ConstraintChecker @Inject constructor(private val activePlugin: ActivePluginProvider) : ConstraintsInterface {
fun isLoopInvocationAllowed(): Constraint<Boolean> =
isLoopInvocationAllowed(Constraint(true))

View file

@ -9,7 +9,7 @@ import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class ReceiverStatusStore @Inject constructor(val context: Context, val rxBus: RxBusWrapper) {
open class ReceiverStatusStore @Inject constructor(val context: Context, val rxBus: RxBusWrapper) {
var lastNetworkEvent: EventNetworkChange? = null

View file

@ -18,7 +18,7 @@ import javax.inject.Singleton
* emulates the methods but ignores the request if the instance is null or invalid.
*/
@Singleton
class FabricPrivacy @Inject constructor(
open class FabricPrivacy @Inject constructor(
private val aapsLogger: AAPSLogger,
private val sp: SP
) {

View file

@ -18,7 +18,7 @@ import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class AppRepository @Inject internal constructor(
open class AppRepository @Inject internal constructor(
internal val database: AppDatabase
) {