-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathDistributionHttpClientTest.kt
More file actions
54 lines (44 loc) · 1.43 KB
/
DistributionHttpClientTest.kt
File metadata and controls
54 lines (44 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package io.sentry.android.distribution
import io.sentry.SentryOptions
import org.junit.Assert.*
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
class DistributionHttpClientTest {
private lateinit var options: SentryOptions
private lateinit var httpClient: DistributionHttpClient
@Before
fun setUp() {
options =
SentryOptions().apply {
connectionTimeoutMillis = 10000
readTimeoutMillis = 10000
}
options.distribution.apply {
orgSlug = "sentry"
projectSlug = "launchpad-test"
orgAuthToken = "DONT_CHECK_THIS_IN"
sentryBaseUrl = "https://sentry.io"
}
httpClient = DistributionHttpClient(options)
}
@Test
@Ignore("This is just used for testing against the real API.")
fun `test checkForUpdates with real API`() {
val params =
DistributionHttpClient.UpdateCheckParams(
appId = "com.emergetools.hackernews",
versionName = "1.0.0",
versionCode = 5L,
buildConfiguration = "release",
)
val response = httpClient.checkForUpdates(params)
// Print response for debugging
println("HTTP Status: ${response.statusCode}")
println("Response Body: ${response.body}")
println("Is Successful: ${response.isSuccessful}")
// Basic assertions
assertTrue("Response should have a status code", response.statusCode > 0)
assertNotNull("Response body should not be null", response.body)
}
}