File tree 3 files changed +13
-5
lines changed
android/src/test/java/com/amplitude/android
core/src/main/java/com/amplitude/core
3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,11 @@ import org.junit.Assert.assertEquals
21
21
import org.junit.Assert.assertNotNull
22
22
import org.junit.Assert.assertTrue
23
23
import org.junit.Before
24
- import org.junit.Ignore
25
24
import org.junit.Test
26
25
import org.junit.runner.RunWith
27
26
import org.robolectric.RobolectricTestRunner
28
27
import java.util.concurrent.TimeUnit
29
28
30
- @Ignore
31
29
@RunWith(RobolectricTestRunner ::class )
32
30
class ResponseHandlerTest {
33
31
private lateinit var server: MockWebServer
Original file line number Diff line number Diff line change @@ -156,10 +156,10 @@ open class Amplitude internal constructor(
156
156
options : EventOptions ? = null,
157
157
callback : EventCallBack ? = null,
158
158
): Amplitude {
159
- options ?. let {
159
+ options?. let {
160
160
event.mergeEventOptions(it)
161
161
}
162
- callback ?. let {
162
+ callback?. let {
163
163
event.callback = it
164
164
}
165
165
process(event)
Original file line number Diff line number Diff line change @@ -30,6 +30,15 @@ class EventPipeline(
30
30
private var scheduled: Boolean
31
31
var flushSizeDivider: AtomicInteger = AtomicInteger (1 )
32
32
33
+ private val responseHandler by lazy {
34
+ storage.getResponseHandler(
35
+ this @EventPipeline,
36
+ amplitude.configuration,
37
+ scope,
38
+ amplitude.retryDispatcher,
39
+ )
40
+ }
41
+
33
42
companion object {
34
43
internal const val UPLOAD_SIG = " #!upload"
35
44
}
@@ -116,7 +125,8 @@ class EventPipeline(
116
125
if (eventsString.isEmpty()) continue
117
126
118
127
val diagnostics = amplitude.diagnostics.extractDiagnostics()
119
- httpClient.upload(eventsString, diagnostics)
128
+ val response = httpClient.upload(eventsString, diagnostics)
129
+ responseHandler.handle(response, events, eventsString)
120
130
} catch (e: FileNotFoundException ) {
121
131
e.message?.let {
122
132
amplitude.logger.warn(" Event storage file not found: $it " )
You can’t perform that action at this time.
0 commit comments