Skip to content

Commit 62b4a5b

Browse files
committed
Merge branch 'release/1.4.13'
2 parents 499c939 + 8272b1b commit 62b4a5b

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

pam-android-kotlin/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies {
4343
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
4444
implementation "org.jetbrains.kotlin:kotlin-reflect:1.7.0"
4545
implementation 'com.google.firebase:firebase-messaging-ktx:23.0.6'
46-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0-native-mt'
46+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
4747
implementation 'com.google.code.gson:gson:2.9.0'
4848
implementation ('com.github.mrmike:ok2curl:0.7.0'){
4949
exclude group:"com.squareup.okhttp3", module:"okhttp"
@@ -53,4 +53,10 @@ dependencies {
5353
implementation 'com.github.bumptech.glide:glide:4.13.0'
5454
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
5555
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.3'
56+
57+
testImplementation 'org.robolectric:robolectric:4.8'
58+
testImplementation('org.threeten:threetenbp:1.4.2') {
59+
exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
60+
}
61+
testImplementation "androidx.test:core-ktx:1.4.0"
5662
}

pam-android-kotlin/src/androidTest/java/ai/pams/android/kotlin/ExampleInstrumentedTest.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package ai.pams.android.kotlin
22

33
import ai.pams.android.kotlin.flex.parser.FlexParser
4-
import androidx.test.platform.app.InstrumentationRegistry
54
import androidx.test.ext.junit.runners.AndroidJUnit4
6-
5+
import androidx.test.platform.app.InstrumentationRegistry
6+
import org.junit.Assert.assertEquals
77
import org.junit.Test
88
import org.junit.runner.RunWith
99

10-
import org.junit.Assert.*
11-
1210
/**
1311
* Instrumented test, which will execute on an Android device.
1412
*

pam-android-kotlin/src/main/java/ai/pams/android/kotlin/utils/DateUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.threeten.bp.format.DateTimeFormatter
77
class DateUtils {
88
companion object {
99

10-
fun getDateFormat() = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
10+
fun getDateFormat() = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.of("GMT0"))
1111

1212
fun hourFromGMT(): Int {
1313
val now = LocalDateTime.now()
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
package ai.pams.android.kotlin
22

3-
import org.junit.Test
4-
3+
import ai.pams.android.kotlin.utils.DateUtils
54
import org.junit.Assert.*
5+
import org.junit.Test
6+
import org.junit.runner.RunWith
7+
import org.robolectric.RobolectricTestRunner
68

79
/**
810
* Example local unit test, which will execute on the development machine (host).
911
*
1012
* See [testing documentation](http://d.android.com/tools/testing).
1113
*/
14+
@RunWith(RobolectricTestRunner::class)
1215
class ExampleUnitTest {
1316
@Test
14-
fun addition_isCorrect() {
15-
assertEquals(4, 2 + 2)
17+
fun testParseDate() {
18+
val str = "2022-06-29 03:53:51"
19+
val date = DateUtils.localDateTimeFromString(str)
20+
assertEquals(date.hour, 10)
1621
}
1722
}

0 commit comments

Comments
 (0)