Convert date in notes

This commit is contained in:
Mikołaj Pich 2018-08-21 01:56:36 +02:00
parent 9007f2ff3f
commit 1d2516a59b
No known key found for this signature in database
GPG key ID: F62B26E36D4C4BAA
3 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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()
}

View file

@ -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)