Skip to content

Commit 8a551f2

Browse files
committed
Upload test to support realtime payload typing
1 parent 5f9c92a commit 8a551f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/languages/android/ServiceTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import java.io.IOException
2727
import java.nio.file.Files
2828
import java.nio.file.Paths
2929

30+
data class TestPayload(val response: String)
31+
3032
@Config(manifest=Config.NONE)
3133
@RunWith(AndroidJUnit4::class)
3234
class ServiceTest {
@@ -61,8 +63,8 @@ class ServiceTest {
6163
val realtime = Realtime(client)
6264
var realtimeResponse = "Realtime failed!"
6365

64-
realtime.subscribe("tests") {
65-
realtimeResponse = it["response"]!! as String
66+
realtime.subscribe("tests", payloadType = TestPayload::class.java) {
67+
realtimeResponse = it.payload.response
6668
}
6769

6870
runBlocking {

0 commit comments

Comments
 (0)