Convert date in notes
This commit is contained in:
parent
9007f2ff3f
commit
1d2516a59b
3 changed files with 9 additions and 2 deletions
|
@ -1,9 +1,11 @@
|
|||
package io.github.wulkanowy.api.notes
|
||||
|
||||
import pl.droidsonroids.jspoon.annotation.Selector
|
||||
import java.util.*
|
||||
|
||||
class Note {
|
||||
lateinit var date: String
|
||||
|
||||
lateinit var date: Date
|
||||
|
||||
@Selector(".wartosc", index = 0)
|
||||
lateinit var teacher: String
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
package io.github.wulkanowy.api.notes
|
||||
|
||||
import io.github.wulkanowy.api.DATE_FORMAT
|
||||
import pl.droidsonroids.jspoon.annotation.Format
|
||||
import pl.droidsonroids.jspoon.annotation.Selector
|
||||
import java.util.*
|
||||
|
||||
class NotesResponse {
|
||||
|
||||
@Selector(".mainContainer article")
|
||||
var notes: List<Note> = listOf()
|
||||
|
||||
@Format(DATE_FORMAT)
|
||||
@Selector(".mainContainer h2")
|
||||
var dates: List<String> = listOf()
|
||||
var dates: List<Date> = listOf()
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ class VulcanTest {
|
|||
|
||||
val values = notesObserver.values()[0]
|
||||
|
||||
assertEquals(getDate(2018, 3, 26), values[0].date)
|
||||
assertEquals("Janusz Tracz", values[0].teacher)
|
||||
assertEquals("Udział w konkursie szkolnym +20 pkt", values[0].category)
|
||||
assertEquals("+ 20p za udział w Konkursie Języka Angielskiego", values[0].content)
|
||||
|
|
Loading…
Reference in a new issue