diff --git a/app/build.gradle b/app/build.gradle index 1345829771..87da8f35c3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -119,7 +119,7 @@ android { } - flavorDimensions "standard" + flavorDimensions = ["standard"] productFlavors { full { applicationId "info.nightscout.androidaps" diff --git a/build.gradle b/build.gradle index 233ae72292..bb4600c60f 100644 --- a/build.gradle +++ b/build.gradle @@ -24,10 +24,10 @@ buildscript { commonslang3_version = '3.13.0' commonscodec_version = '1.16.0' guava_version = '32.1.2-jre' - jodatime_version = '2.10.14' + jodatime_version = '2.12.5' work_version = '2.8.1' tink_version = '1.10.0' - json_version = '20220320' + json_version = '20230618' joda_version = '2.12.5' swipe_version = '1.1.0' @@ -39,7 +39,7 @@ buildscript { okhttp3_version = '4.11.0' byteBuddy_version = '1.12.8' - androidx_junit_version = '1.1.4' + androidx_junit_version = '1.1.5' androidx_rules_version = '1.5.0' rxandroidble_version = '1.12.1' diff --git a/core/graphview/build.gradle b/core/graphview/build.gradle index e8e38632eb..cf3075074d 100644 --- a/core/graphview/build.gradle +++ b/core/graphview/build.gradle @@ -5,6 +5,7 @@ plugins { } apply from: "${project.rootDir}/core/main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" android { diff --git a/core/main/android_module_dependencies.gradle b/core/main/android_module_dependencies.gradle index 8e2a9b7ee7..d8717e8cae 100644 --- a/core/main/android_module_dependencies.gradle +++ b/core/main/android_module_dependencies.gradle @@ -1,6 +1,6 @@ android { - flavorDimensions "standard" + flavorDimensions = ["standard"] productFlavors { full { dimension "standard" diff --git a/core/main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt b/core/main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt index 027848cc0c..03d53ef130 100644 --- a/core/main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt +++ b/core/main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt @@ -8,7 +8,7 @@ import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.pump.DetailedBolusInfo import org.apache.commons.lang3.builder.EqualsBuilder -import org.junit.Assert +import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mock @@ -18,14 +18,14 @@ class DetailedBolusInfoTest : TestBase() { @Test fun toStringShouldBeOverloaded() { val detailedBolusInfo = DetailedBolusInfo() - Assert.assertEquals(true, detailedBolusInfo.toJsonString().contains("insulin")) + Assertions.assertEquals(true, detailedBolusInfo.toJsonString().contains("insulin")) } @Test fun copyShouldCopyAllProperties() { val d1 = DetailedBolusInfo() d1.deliverAtTheLatest = 123 val d2 = d1.copy() - Assert.assertEquals(true, EqualsBuilder.reflectionEquals(d2, d1)) + Assertions.assertTrue(EqualsBuilder.reflectionEquals(d2, d1, arrayListOf("id"))) } private fun fromJsonString(json: String): DetailedBolusInfo = @@ -41,10 +41,10 @@ class DetailedBolusInfoTest : TestBase() { detailedBolusInfo.eventType = DetailedBolusInfo.EventType.BOLUS_WIZARD val serialized = detailedBolusInfo.toJsonString() val deserialized = fromJsonString(serialized) - Assert.assertEquals(1L, deserialized.bolusCalculatorResult?.timestamp) - Assert.assertEquals(DetailedBolusInfo.EventType.BOLUS_WIZARD, deserialized.eventType) + Assertions.assertEquals(1L, deserialized.bolusCalculatorResult?.timestamp) + Assertions.assertEquals(DetailedBolusInfo.EventType.BOLUS_WIZARD, deserialized.eventType) // Context should be excluded - Assert.assertNull(deserialized.context) + Assertions.assertNull(deserialized.context) } @Test @@ -56,12 +56,12 @@ class DetailedBolusInfoTest : TestBase() { detailedBolusInfo.glucoseType = DetailedBolusInfo.MeterType.FINGER val therapyEvent = detailedBolusInfo.createTherapyEvent() - Assert.assertEquals(1000L, therapyEvent.timestamp) - Assert.assertEquals(TherapyEvent.Type.MEAL_BOLUS, therapyEvent.type) - Assert.assertEquals(TherapyEvent.GlucoseUnit.MGDL, therapyEvent.glucoseUnit) - Assert.assertEquals("note", therapyEvent.note) - Assert.assertEquals(180.0, therapyEvent.glucose) - Assert.assertEquals(TherapyEvent.MeterType.FINGER, therapyEvent.glucoseType) + Assertions.assertEquals(1000L, therapyEvent.timestamp) + Assertions.assertEquals(TherapyEvent.Type.MEAL_BOLUS, therapyEvent.type) + Assertions.assertEquals(TherapyEvent.GlucoseUnit.MGDL, therapyEvent.glucoseUnit) + Assertions.assertEquals("note", therapyEvent.note) + Assertions.assertEquals(180.0, therapyEvent.glucose) + Assertions.assertEquals(TherapyEvent.MeterType.FINGER, therapyEvent.glucoseType) } @Test @@ -72,9 +72,9 @@ class DetailedBolusInfoTest : TestBase() { detailedBolusInfo.insulin = 7.0 val bolus = detailedBolusInfo.createBolus() - Assert.assertEquals(1000L, bolus.timestamp) - Assert.assertEquals(Bolus.Type.SMB, bolus.type) - Assert.assertEquals(7.0, bolus.amount, 0.01) + Assertions.assertEquals(1000L, bolus.timestamp) + Assertions.assertEquals(Bolus.Type.SMB, bolus.type) + Assertions.assertEquals(7.0, bolus.amount, 0.01) } @Test @@ -84,8 +84,8 @@ class DetailedBolusInfoTest : TestBase() { detailedBolusInfo.carbs = 6.0 val carbs = detailedBolusInfo.createCarbs() - Assert.assertEquals(1000L, carbs.timestamp) - Assert.assertEquals(6.0, carbs.amount, 0.01) + Assertions.assertEquals(1000L, carbs.timestamp) + Assertions.assertEquals(6.0, carbs.amount, 0.01) } private fun createBolusCalculatorResult(): BolusCalculatorResult = diff --git a/core/main/test_dependencies.gradle b/core/main/test_dependencies.gradle index b2cd685f5b..f2b8d656af 100644 --- a/core/main/test_dependencies.gradle +++ b/core/main/test_dependencies.gradle @@ -7,11 +7,11 @@ dependencies { testImplementation "org.mockito.kotlin:mockito-kotlin:4.1.0" //testImplementation "org.mockito:mockito-inline:$mockito_version" testImplementation "joda-time:joda-time:$jodatime_version" - testImplementation "com.google.truth:truth:1.1.3" + testImplementation 'com.google.truth:truth:1.1.5' testImplementation "org.skyscreamer:jsonassert:1.5.0" testImplementation "org.hamcrest:hamcrest-all:1.3" - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' androidTestImplementation "androidx.test.ext:junit-ktx:$androidx_junit_version" androidTestImplementation "androidx.test:rules:$androidx_rules_version" diff --git a/core/ui/build.gradle b/core/ui/build.gradle index 5d2332be31..3ed9373b28 100644 --- a/core/ui/build.gradle +++ b/core/ui/build.gradle @@ -1,9 +1,11 @@ plugins { id 'com.android.library' id 'kotlin-android' + id 'kotlin-kapt' } apply from: "${project.rootDir}/core/main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" android { namespace 'info.nightscout.core.ui' diff --git a/database/entities/build.gradle b/database/entities/build.gradle index 4e4311ac82..918416feb0 100644 --- a/database/entities/build.gradle +++ b/database/entities/build.gradle @@ -6,6 +6,7 @@ plugins { } apply from: "${project.rootDir}/core/main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" android { diff --git a/wear/build.gradle b/wear/build.gradle index 8b1b954bb0..ac0b0e1625 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -57,7 +57,7 @@ android { viewBinding true } - flavorDimensions "standard" + flavorDimensions = ["standard"] productFlavors { full { applicationId "info.nightscout.androidaps"