Pārlūkot izejas kodu

-Update library and add DateHelperUnitTest

ilhamitubagoes 4 gadi atpakaļ
vecāks
revīzija
1b14f717fe

+ 6 - 6
app/build.gradle

@@ -47,18 +47,18 @@ dependencies {
47 47
 
48 48
     //RX JAVA
49 49
     implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
50
-    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
50
+    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
51 51
 
52 52
     //GSON
53
-    implementation 'com.google.code.gson:gson:2.8.5'
53
+    implementation 'com.google.code.gson:gson:2.8.6'
54 54
 
55 55
     //OKHTTP
56
-    implementation 'com.squareup.okio:okio:2.1.0'
57
-    implementation 'com.squareup.okhttp3:okhttp:3.12.0'
58
-    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
56
+    implementation 'com.squareup.okio:okio:2.7.0-alpha.lockfree.1'
57
+    implementation 'com.squareup.okhttp3:okhttp:4.7.2'
58
+    implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
59 59
 
60 60
     //RETROFIT
61
-    implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
61
+    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
62 62
 
63 63
     //Circle Image
64 64
     implementation 'de.hdodenhof:circleimageview:3.1.0'

+ 21 - 0
app/src/test/java/com/fusi24/rfid/DateHelperUnitTest.java

@@ -0,0 +1,21 @@
1
+package com.fusi24.rfid;
2
+
3
+import com.fusi24.rfid.util.DateHelper;
4
+
5
+import org.junit.Test;
6
+
7
+import static org.junit.Assert.*;
8
+
9
+/**
10
+ * Example local unit test, which will execute on the development machine (host).
11
+ *
12
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
13
+ */
14
+public class DateHelperUnitTest {
15
+    @Test
16
+    public void convertDateToReadableDateTest() {
17
+        String dateFromServer = "2020-05-31T15:04:10+00:00"; // Using ISO 8601 formatted date
18
+        String convertDate = DateHelper.convertDateToReadableDate(dateFromServer); // change to dd-MMM-yyyy
19
+        assertEquals("This test created in 31 May 2020", "31-May-2020", convertDate);
20
+    }
21
+}

+ 0 - 17
app/src/test/java/com/fusi24/rfid/ExampleUnitTest.java

@@ -1,17 +0,0 @@
1
-package com.fusi24.rfid;
2
-
3
-import org.junit.Test;
4
-
5
-import static org.junit.Assert.*;
6
-
7
-/**
8
- * Example local unit test, which will execute on the development machine (host).
9
- *
10
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
11
- */
12
-public class ExampleUnitTest {
13
-    @Test
14
-    public void addition_isCorrect() {
15
-        assertEquals(4, 2 + 2);
16
-    }
17
-}