diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt index e62bcd2990..efbd6deb95 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt @@ -1,19 +1,16 @@ package info.nightscout.androidaps.plugins.source +import dagger.android.AndroidInjector +import dagger.android.HasAndroidInjector +import info.TestBase import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.utils.resources.ResourceHelper import org.junit.Assert import org.junit.Before -import org.junit.Rule import org.junit.Test import org.mockito.Mock -import org.mockito.junit.MockitoJUnit -import org.mockito.junit.MockitoRule - -class GlimpPluginTest { - @get:Rule - val mockitoRule: MockitoRule = MockitoJUnit.rule() +class GlimpPluginTest : TestBase() { private lateinit var glimpPlugin: GlimpPlugin @Mock lateinit var aapsLogger: AAPSLogger @@ -21,7 +18,7 @@ class GlimpPluginTest { @Before fun setup() { - glimpPlugin = GlimpPlugin(resourceHelper, aapsLogger) + glimpPlugin = GlimpPlugin(HasAndroidInjector { AndroidInjector { } }, resourceHelper, aapsLogger) } @Test fun advancedFilteringSupported() { diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.java deleted file mode 100644 index 0610e7c639..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package info.nightscout.androidaps.plugins.source; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.modules.junit4.PowerMockRunner; - -@RunWith(PowerMockRunner.class) -public class MM640GPluginTest { - - @Test - public void getPlugin() { - Assert.assertNotEquals(null, MM640gPlugin.getPlugin()); - } - - @Test - public void advancedFilteringSupported() { - Assert.assertEquals(false, MM640gPlugin.getPlugin().advancedFilteringSupported()); - } -} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt new file mode 100644 index 0000000000..113ef0df56 --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt @@ -0,0 +1,31 @@ +package info.nightscout.androidaps.plugins.source + +import dagger.android.AndroidInjector +import dagger.android.HasAndroidInjector +import info.TestBase +import info.nightscout.androidaps.logging.AAPSLogger +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.Mock +import org.powermock.modules.junit4.PowerMockRunner + +@RunWith(PowerMockRunner::class) +class MM640GPluginTest : TestBase() { + + private lateinit var mM640gPlugin: MM640gPlugin + + @Mock lateinit var aapsLogger: AAPSLogger + @Mock lateinit var resourceHelper: ResourceHelper + + @Before + fun setup() { + mM640gPlugin = MM640gPlugin(HasAndroidInjector { AndroidInjector { } }, resourceHelper, aapsLogger) + } + + @Test fun advancedFilteringSupported() { + Assert.assertEquals(false, mM640gPlugin.advancedFilteringSupported()) + } +} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.java deleted file mode 100644 index f56bc3fa0b..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package info.nightscout.androidaps.plugins.source; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.modules.junit4.PowerMockRunner; - -@RunWith(PowerMockRunner.class) -public class NSClientPluginTest { - - @Test - public void getPlugin() { - Assert.assertNotEquals(null, NSClientPlugin.getPlugin()); - } - - @Test - public void advancedFilteringSupported() { - Assert.assertEquals(false, NSClientPlugin.getPlugin().advancedFilteringSupported()); - } -} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt new file mode 100644 index 0000000000..1ff55304f7 --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt @@ -0,0 +1,33 @@ +package info.nightscout.androidaps.plugins.source + +import dagger.android.AndroidInjector +import dagger.android.HasAndroidInjector +import info.TestBase +import info.nightscout.androidaps.logging.AAPSLogger +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 + + @Mock lateinit var aapsLogger: AAPSLogger + @Mock lateinit var resourceHelper: ResourceHelper + @Mock lateinit var sp: SP + + @Before + fun setup() { + nsClientSourcePlugin = NSClientSourcePlugin(HasAndroidInjector { AndroidInjector { } }, resourceHelper, aapsLogger, sp) + } + + @Test fun advancedFilteringSupported() { + Assert.assertEquals(false, nsClientSourcePlugin.advancedFilteringSupported()) + } +} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.java deleted file mode 100644 index b43c8a44df..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package info.nightscout.androidaps.plugins.source; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.modules.junit4.PowerMockRunner; - -@RunWith(PowerMockRunner.class) -public class XdripPluginTest { - - @Test - public void getPlugin() { - Assert.assertNotEquals(null, XdripPlugin.getPlugin()); - } - - @Test - public void advancedFilteringSupported() { - Assert.assertEquals(false, XdripPlugin.getPlugin().advancedFilteringSupported()); - } -} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.kt new file mode 100644 index 0000000000..16454b06ea --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.kt @@ -0,0 +1,31 @@ +package info.nightscout.androidaps.plugins.source + +import dagger.android.AndroidInjector +import dagger.android.HasAndroidInjector +import info.TestBase +import info.nightscout.androidaps.logging.AAPSLogger +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.Mock +import org.powermock.modules.junit4.PowerMockRunner + +@RunWith(PowerMockRunner::class) +class XdripPluginTest : TestBase() { + + private lateinit var xdripPlugin: XdripPlugin + + @Mock lateinit var aapsLogger: AAPSLogger + @Mock lateinit var resourceHelper: ResourceHelper + + @Before + fun setup() { + xdripPlugin = XdripPlugin(HasAndroidInjector { AndroidInjector { } }, resourceHelper, aapsLogger) + } + + @Test fun advancedFilteringSupported() { + Assert.assertEquals(false, xdripPlugin.advancedFilteringSupported()) + } +} \ No newline at end of file