@datadog/mobile-react-native 1.8.5 → 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +8 -2
- package/android/build.gradle +17 -5
- package/android/gradle.properties +4 -4
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +54 -13
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +36 -9
- package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +1 -2
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +37 -17
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +3 -3
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +71 -70
- package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +10 -2
- package/android/src/main/kotlin/com/datadog/reactnative/NoOpViewTrackingStrategy.kt +2 -1
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdTrace.kt +1 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +48 -30
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +648 -641
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +1 -1
- package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +122 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/ReflectUtils.kt +0 -1
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ActionEventForgeryFactory.kt +1 -1
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +3 -3
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ResourceEventForgeryFactory.kt +1 -1
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +4 -0
- package/ios/Sources/DdLogsImplementation.swift +10 -38
- package/ios/Sources/DdRumImplementation.swift +26 -39
- package/ios/Sources/DdSdkConfiguration.swift +55 -8
- package/ios/Sources/DdSdkImplementation.swift +141 -143
- package/ios/Sources/DdTraceImplementation.swift +4 -5
- package/ios/Sources/RNDdSdkConfiguration.swift +4 -2
- package/ios/Sources/RUMMonitorInternalProtocol.swift +40 -0
- package/jest/mock.js +1 -0
- package/lib/commonjs/DdSdkReactNative.js +2 -2
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/index.js +20 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +2 -2
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +10 -4
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +2 -2
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js +26 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js +30 -10
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +37 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +2 -2
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +2 -2
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/utils/jsUtils.js +26 -0
- package/lib/commonjs/utils/jsUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdSdkReactNative.js +1 -1
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/rum/DdRum.js +1 -1
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +8 -3
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js +13 -0
- package/lib/module/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js +30 -10
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +36 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/trace/DdTrace.js +1 -1
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/utils/jsUtils.js +17 -0
- package/lib/module/utils/jsUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.d.ts +4 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +6 -0
- package/lib/typescript/utils/jsUtils.d.ts +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +11 -3
- package/src/DdSdkReactNative.tsx +1 -1
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +2 -0
- package/src/index.tsx +9 -1
- package/src/rum/DdRum.ts +1 -1
- package/src/rum/__tests__/DdRum.test.ts +1 -1
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +13 -4
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +1 -1
- package/src/rum/instrumentation/resourceTracking/graphql/__tests__/graphqlHeaders.test.ts +28 -0
- package/src/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.ts +15 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.ts +35 -20
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +48 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +178 -2
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +7 -0
- package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +1 -1
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +2 -2
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +2 -2
- package/src/trace/DdTrace.ts +1 -1
- package/src/utils/__mocks__/jsUtils.ts +21 -0
- package/src/utils/jsUtils.ts +20 -0
- package/src/version.ts +1 -1
- /package/lib/commonjs/{TimeProvider.js → utils/TimeProvider.js} +0 -0
- /package/lib/commonjs/{TimeProvider.js.map → utils/TimeProvider.js.map} +0 -0
- /package/lib/commonjs/{Timer.js → utils/Timer.js} +0 -0
- /package/lib/commonjs/{Timer.js.map → utils/Timer.js.map} +0 -0
- /package/lib/commonjs/{errorUtils.js → utils/errorUtils.js} +0 -0
- /package/lib/commonjs/{errorUtils.js.map → utils/errorUtils.js.map} +0 -0
- /package/lib/commonjs/{longTasksUtils.js → utils/longTasksUtils.js} +0 -0
- /package/lib/commonjs/{longTasksUtils.js.map → utils/longTasksUtils.js.map} +0 -0
- /package/lib/module/{TimeProvider.js → utils/TimeProvider.js} +0 -0
- /package/lib/module/{TimeProvider.js.map → utils/TimeProvider.js.map} +0 -0
- /package/lib/module/{Timer.js → utils/Timer.js} +0 -0
- /package/lib/module/{Timer.js.map → utils/Timer.js.map} +0 -0
- /package/lib/module/{errorUtils.js → utils/errorUtils.js} +0 -0
- /package/lib/module/{errorUtils.js.map → utils/errorUtils.js.map} +0 -0
- /package/lib/module/{longTasksUtils.js → utils/longTasksUtils.js} +0 -0
- /package/lib/module/{longTasksUtils.js.map → utils/longTasksUtils.js.map} +0 -0
- /package/lib/typescript/{TimeProvider.d.ts → utils/TimeProvider.d.ts} +0 -0
- /package/lib/typescript/{Timer.d.ts → utils/Timer.d.ts} +0 -0
- /package/lib/typescript/{errorUtils.d.ts → utils/errorUtils.d.ts} +0 -0
- /package/lib/typescript/{longTasksUtils.d.ts → utils/longTasksUtils.d.ts} +0 -0
- /package/src/{TimeProvider.tsx → utils/TimeProvider.tsx} +0 -0
- /package/src/{Timer.ts → utils/Timer.ts} +0 -0
- /package/src/{__tests__ → utils/__tests__}/TimeProvider.test.tsx +0 -0
- /package/src/{__tests__ → utils/__tests__}/Timer.test.ts +0 -0
- /package/src/{__tests__ → utils/__tests__}/errorUtils.test.ts +0 -0
- /package/src/{__tests__ → utils/__tests__}/longTasksUtils.test.ts +0 -0
- /package/src/{errorUtils.ts → utils/errorUtils.ts} +0 -0
- /package/src/{longTasksUtils.ts → utils/longTasksUtils.ts} +0 -0
|
@@ -12,24 +12,23 @@ import android.view.Choreographer
|
|
|
12
12
|
import com.datadog.android.DatadogSite
|
|
13
13
|
import com.datadog.android.core.configuration.BatchSize
|
|
14
14
|
import com.datadog.android.core.configuration.Configuration
|
|
15
|
-
import com.datadog.android.core.configuration.Credentials
|
|
16
15
|
import com.datadog.android.core.configuration.UploadFrequency
|
|
17
|
-
import com.datadog.android.core.configuration.VitalsUpdateFrequency
|
|
18
16
|
import com.datadog.android.event.EventMapper
|
|
19
|
-
import com.datadog.android.
|
|
17
|
+
import com.datadog.android.log.LogsConfiguration
|
|
20
18
|
import com.datadog.android.privacy.TrackingConsent
|
|
21
|
-
import com.datadog.android.rum.
|
|
22
|
-
import com.datadog.android.rum.RumMonitor
|
|
19
|
+
import com.datadog.android.rum.RumConfiguration
|
|
23
20
|
import com.datadog.android.rum.RumPerformanceMetric
|
|
24
21
|
import com.datadog.android.rum._RumInternalProxy
|
|
22
|
+
import com.datadog.android.rum.configuration.VitalsUpdateFrequency
|
|
25
23
|
import com.datadog.android.rum.model.ActionEvent
|
|
26
24
|
import com.datadog.android.rum.model.ResourceEvent
|
|
27
25
|
import com.datadog.android.rum.tracking.ActivityViewTrackingStrategy
|
|
28
26
|
import com.datadog.android.telemetry.model.TelemetryConfigurationEvent
|
|
29
|
-
import com.datadog.android.
|
|
27
|
+
import com.datadog.android.trace.TraceConfiguration
|
|
28
|
+
import com.datadog.android.trace.TracingHeaderType
|
|
30
29
|
import com.datadog.tools.unit.GenericAssert.Companion.assertThat
|
|
30
|
+
import com.datadog.tools.unit.MockRumMonitor
|
|
31
31
|
import com.datadog.tools.unit.forge.BaseConfigurator
|
|
32
|
-
import com.datadog.tools.unit.getStaticValue
|
|
33
32
|
import com.datadog.tools.unit.setStaticValue
|
|
34
33
|
import com.datadog.tools.unit.toReadableArray
|
|
35
34
|
import com.datadog.tools.unit.toReadableJavaOnlyMap
|
|
@@ -65,7 +64,6 @@ import fr.xgouchet.elmyr.junit5.ForgeExtension
|
|
|
65
64
|
import java.net.InetSocketAddress
|
|
66
65
|
import java.net.Proxy
|
|
67
66
|
import java.util.Locale
|
|
68
|
-
import java.util.concurrent.atomic.AtomicBoolean
|
|
69
67
|
import java.util.stream.Stream
|
|
70
68
|
import org.assertj.core.api.Assertions.assertThat
|
|
71
69
|
import org.junit.jupiter.api.AfterEach
|
|
@@ -111,7 +109,7 @@ internal class DdSdkTest {
|
|
|
111
109
|
lateinit var mockContext: ReactApplicationContext
|
|
112
110
|
|
|
113
111
|
@Mock
|
|
114
|
-
lateinit var mockRumMonitor:
|
|
112
|
+
lateinit var mockRumMonitor: MockRumMonitor
|
|
115
113
|
|
|
116
114
|
@Mock
|
|
117
115
|
lateinit var mockRumInternalProxy: _RumInternalProxy
|
|
@@ -133,7 +131,7 @@ internal class DdSdkTest {
|
|
|
133
131
|
|
|
134
132
|
@BeforeEach
|
|
135
133
|
fun `set up`() {
|
|
136
|
-
|
|
134
|
+
whenever(mockDatadog.getRumMonitor()) doReturn mockRumMonitor
|
|
137
135
|
whenever(mockRumMonitor._getInternal()) doReturn mockRumInternalProxy
|
|
138
136
|
|
|
139
137
|
doNothing().whenever(mockChoreographer).postFrameCallback(any())
|
|
@@ -156,8 +154,6 @@ internal class DdSdkTest {
|
|
|
156
154
|
@AfterEach
|
|
157
155
|
fun `tear down`() {
|
|
158
156
|
GlobalState.globalAttributes.clear()
|
|
159
|
-
GlobalRum.javaClass.setStaticValue("monitor", mock<RumMonitor>())
|
|
160
|
-
GlobalRum.javaClass.getStaticValue<GlobalRum, AtomicBoolean>("isRegistered").set(false)
|
|
161
157
|
}
|
|
162
158
|
|
|
163
159
|
// region initialize / nativeCrashReportEnabled
|
|
@@ -166,8 +162,10 @@ internal class DdSdkTest {
|
|
|
166
162
|
fun `𝕄 initialize native SDK 𝕎 initialize() {nativeCrashReportEnabled=true}`() {
|
|
167
163
|
// Given
|
|
168
164
|
val bridgeConfiguration = fakeConfiguration.copy(nativeCrashReportEnabled = true)
|
|
169
|
-
val
|
|
170
|
-
val
|
|
165
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
166
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
167
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
168
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
171
169
|
|
|
172
170
|
// When
|
|
173
171
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -176,46 +174,38 @@ internal class DdSdkTest {
|
|
|
176
174
|
inOrder(mockDatadog) {
|
|
177
175
|
verify(mockDatadog).initialize(
|
|
178
176
|
same(mockContext),
|
|
179
|
-
|
|
180
|
-
configCaptor.capture(),
|
|
177
|
+
sdkConfigCaptor.capture(),
|
|
181
178
|
any()
|
|
182
179
|
)
|
|
183
|
-
verify(mockDatadog).
|
|
180
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
181
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
182
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
184
183
|
}
|
|
185
|
-
assertThat(
|
|
184
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
186
185
|
.hasField("coreConfig") {
|
|
187
186
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
188
187
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
189
188
|
}
|
|
190
|
-
.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
.
|
|
194
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
195
|
-
}
|
|
196
|
-
.hasField("crashReportConfig") {
|
|
197
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
198
|
-
}
|
|
199
|
-
.hasField("rumConfig") {
|
|
200
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
201
|
-
}
|
|
189
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
190
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
191
|
+
.hasFieldEqualTo("variant", "")
|
|
192
|
+
.hasFieldEqualTo("crashReportsEnabled", true)
|
|
202
193
|
.hasFieldEqualTo(
|
|
203
194
|
"additionalConfig",
|
|
204
195
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
205
196
|
)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
209
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
210
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
197
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
198
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
211
199
|
}
|
|
212
200
|
|
|
213
201
|
@Test
|
|
214
202
|
fun `𝕄 initialize native SDK 𝕎 initialize() {nativeCrashReportEnabled=false}`() {
|
|
215
203
|
// Given
|
|
216
204
|
fakeConfiguration = fakeConfiguration.copy(nativeCrashReportEnabled = false, site = null)
|
|
217
|
-
val
|
|
218
|
-
val
|
|
205
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
206
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
207
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
208
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
219
209
|
|
|
220
210
|
// When
|
|
221
211
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -224,44 +214,38 @@ internal class DdSdkTest {
|
|
|
224
214
|
inOrder(mockDatadog) {
|
|
225
215
|
verify(mockDatadog).initialize(
|
|
226
216
|
same(mockContext),
|
|
227
|
-
|
|
228
|
-
configCaptor.capture(),
|
|
217
|
+
sdkConfigCaptor.capture(),
|
|
229
218
|
any()
|
|
230
219
|
)
|
|
231
|
-
verify(mockDatadog).
|
|
220
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
221
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
222
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
232
223
|
}
|
|
233
|
-
assertThat(
|
|
224
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
234
225
|
.hasField("coreConfig") {
|
|
235
226
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
236
227
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
237
228
|
}
|
|
238
|
-
.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
.
|
|
242
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
243
|
-
}
|
|
244
|
-
.hasFieldEqualTo("crashReportConfig", null)
|
|
245
|
-
.hasField("rumConfig") {
|
|
246
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
247
|
-
}
|
|
229
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
230
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
231
|
+
.hasFieldEqualTo("variant", "")
|
|
232
|
+
.hasFieldEqualTo("crashReportsEnabled", false)
|
|
248
233
|
.hasFieldEqualTo(
|
|
249
234
|
"additionalConfig",
|
|
250
235
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
251
236
|
)
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
255
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
256
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
237
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
238
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
257
239
|
}
|
|
258
240
|
|
|
259
241
|
@Test
|
|
260
242
|
fun `𝕄 initialize native SDK 𝕎 initialize() {nativeCrashReportEnabled=null}`() {
|
|
261
243
|
// Given
|
|
262
244
|
fakeConfiguration = fakeConfiguration.copy(nativeCrashReportEnabled = false, site = null)
|
|
263
|
-
val
|
|
264
|
-
val
|
|
245
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
246
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
247
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
248
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
265
249
|
|
|
266
250
|
// When
|
|
267
251
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -270,36 +254,28 @@ internal class DdSdkTest {
|
|
|
270
254
|
inOrder(mockDatadog) {
|
|
271
255
|
verify(mockDatadog).initialize(
|
|
272
256
|
same(mockContext),
|
|
273
|
-
|
|
274
|
-
configCaptor.capture(),
|
|
257
|
+
sdkConfigCaptor.capture(),
|
|
275
258
|
any()
|
|
276
259
|
)
|
|
277
|
-
verify(mockDatadog).
|
|
260
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
261
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
262
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
278
263
|
}
|
|
279
|
-
assertThat(
|
|
264
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
280
265
|
.hasField("coreConfig") {
|
|
281
266
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
282
267
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
283
268
|
}
|
|
284
|
-
.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
.
|
|
288
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
289
|
-
}
|
|
290
|
-
.hasFieldEqualTo("crashReportConfig", null)
|
|
291
|
-
.hasField("rumConfig") {
|
|
292
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
293
|
-
}
|
|
269
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
270
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
271
|
+
.hasFieldEqualTo("variant", "")
|
|
272
|
+
.hasFieldEqualTo("crashReportsEnabled", false)
|
|
294
273
|
.hasFieldEqualTo(
|
|
295
274
|
"additionalConfig",
|
|
296
275
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
297
276
|
)
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
301
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
302
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
277
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
278
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
303
279
|
}
|
|
304
280
|
|
|
305
281
|
// endregion
|
|
@@ -309,8 +285,10 @@ internal class DdSdkTest {
|
|
|
309
285
|
@Test
|
|
310
286
|
fun `𝕄 initialize native with sample rate SDK 𝕎 initialize() {}`() {
|
|
311
287
|
// Given
|
|
312
|
-
val
|
|
313
|
-
val
|
|
288
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
289
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
290
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
291
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
314
292
|
val expectedRumSampleRate = fakeConfiguration.sampleRate?.toFloat() ?: 100f
|
|
315
293
|
|
|
316
294
|
// When
|
|
@@ -320,36 +298,30 @@ internal class DdSdkTest {
|
|
|
320
298
|
inOrder(mockDatadog) {
|
|
321
299
|
verify(mockDatadog).initialize(
|
|
322
300
|
same(mockContext),
|
|
323
|
-
|
|
324
|
-
configCaptor.capture(),
|
|
301
|
+
sdkConfigCaptor.capture(),
|
|
325
302
|
any()
|
|
326
303
|
)
|
|
327
|
-
verify(mockDatadog).
|
|
304
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
305
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
306
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
328
307
|
}
|
|
329
|
-
assertThat(
|
|
308
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
330
309
|
.hasField("coreConfig") {
|
|
331
310
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
332
311
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
333
312
|
}
|
|
334
|
-
.
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
.hasField("tracesConfig") {
|
|
338
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
339
|
-
}
|
|
340
|
-
.hasField("rumConfig") {
|
|
341
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
342
|
-
it.hasFieldEqualTo("samplingRate", expectedRumSampleRate)
|
|
343
|
-
}
|
|
313
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
314
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
315
|
+
.hasFieldEqualTo("variant", "")
|
|
344
316
|
.hasFieldEqualTo(
|
|
345
317
|
"additionalConfig",
|
|
346
318
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
347
319
|
)
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
320
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
321
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
322
|
+
.hasField("featureConfiguration") {
|
|
323
|
+
it.hasFieldEqualTo("sampleRate", expectedRumSampleRate)
|
|
324
|
+
}
|
|
353
325
|
}
|
|
354
326
|
|
|
355
327
|
// endregion
|
|
@@ -359,8 +331,10 @@ internal class DdSdkTest {
|
|
|
359
331
|
@Test
|
|
360
332
|
fun `𝕄 initialize native with telemetry sample rate SDK 𝕎 initialize() {}`() {
|
|
361
333
|
// Given
|
|
362
|
-
val
|
|
363
|
-
val
|
|
334
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
335
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
336
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
337
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
364
338
|
val expectedTelemetrySampleRate = fakeConfiguration.telemetrySampleRate?.toFloat() ?: 20f
|
|
365
339
|
|
|
366
340
|
// When
|
|
@@ -370,36 +344,30 @@ internal class DdSdkTest {
|
|
|
370
344
|
inOrder(mockDatadog) {
|
|
371
345
|
verify(mockDatadog).initialize(
|
|
372
346
|
same(mockContext),
|
|
373
|
-
|
|
374
|
-
configCaptor.capture(),
|
|
347
|
+
sdkConfigCaptor.capture(),
|
|
375
348
|
any()
|
|
376
349
|
)
|
|
377
|
-
verify(mockDatadog).
|
|
350
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
351
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
352
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
378
353
|
}
|
|
379
|
-
assertThat(
|
|
354
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
380
355
|
.hasField("coreConfig") {
|
|
381
356
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
382
357
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
383
358
|
}
|
|
384
|
-
.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
.hasField("tracesConfig") {
|
|
388
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
389
|
-
}
|
|
390
|
-
.hasField("rumConfig") {
|
|
391
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
392
|
-
it.hasFieldEqualTo("telemetrySamplingRate", expectedTelemetrySampleRate)
|
|
393
|
-
}
|
|
359
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
360
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
361
|
+
.hasFieldEqualTo("variant", "")
|
|
394
362
|
.hasFieldEqualTo(
|
|
395
363
|
"additionalConfig",
|
|
396
364
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
397
365
|
)
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
366
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
367
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
368
|
+
.hasField("featureConfiguration") {
|
|
369
|
+
it.hasFieldEqualTo("telemetrySampleRate", expectedTelemetrySampleRate)
|
|
370
|
+
}
|
|
403
371
|
}
|
|
404
372
|
|
|
405
373
|
// endregion
|
|
@@ -410,8 +378,10 @@ internal class DdSdkTest {
|
|
|
410
378
|
fun `𝕄 initialize native SDK 𝕎 initialize() {additionalConfig=null}`() {
|
|
411
379
|
// Given
|
|
412
380
|
fakeConfiguration = fakeConfiguration.copy(additionalConfig = null)
|
|
413
|
-
val
|
|
414
|
-
val
|
|
381
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
382
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
383
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
384
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
415
385
|
|
|
416
386
|
// When
|
|
417
387
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -420,39 +390,33 @@ internal class DdSdkTest {
|
|
|
420
390
|
inOrder(mockDatadog) {
|
|
421
391
|
verify(mockDatadog).initialize(
|
|
422
392
|
same(mockContext),
|
|
423
|
-
|
|
424
|
-
configCaptor.capture(),
|
|
393
|
+
sdkConfigCaptor.capture(),
|
|
425
394
|
any()
|
|
426
395
|
)
|
|
427
|
-
verify(mockDatadog).
|
|
396
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
397
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
398
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
428
399
|
}
|
|
429
|
-
assertThat(
|
|
400
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
430
401
|
.hasField("coreConfig") {
|
|
431
402
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
432
403
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
433
404
|
}
|
|
434
|
-
.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
.hasField("tracesConfig") {
|
|
438
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
439
|
-
}
|
|
440
|
-
.hasField("rumConfig") {
|
|
441
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
442
|
-
}
|
|
405
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
406
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
407
|
+
.hasFieldEqualTo("variant", "")
|
|
443
408
|
.hasFieldEqualTo("additionalConfig", emptyMap<String, Any?>())
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
447
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
448
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
409
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
410
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
449
411
|
}
|
|
450
412
|
|
|
451
413
|
@Test
|
|
452
414
|
fun `𝕄 initialize native SDK 𝕎 initialize() {additionalConfig=nonNull}`() {
|
|
453
415
|
// Given
|
|
454
|
-
val
|
|
455
|
-
val
|
|
416
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
417
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
418
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
419
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
456
420
|
|
|
457
421
|
// When
|
|
458
422
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -461,35 +425,27 @@ internal class DdSdkTest {
|
|
|
461
425
|
inOrder(mockDatadog) {
|
|
462
426
|
verify(mockDatadog).initialize(
|
|
463
427
|
same(mockContext),
|
|
464
|
-
|
|
465
|
-
configCaptor.capture(),
|
|
428
|
+
sdkConfigCaptor.capture(),
|
|
466
429
|
any()
|
|
467
430
|
)
|
|
468
|
-
verify(mockDatadog).
|
|
431
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
432
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
433
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
469
434
|
}
|
|
470
|
-
assertThat(
|
|
435
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
471
436
|
.hasField("coreConfig") {
|
|
472
437
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
473
438
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
474
439
|
}
|
|
475
|
-
.
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
.hasField("tracesConfig") {
|
|
479
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
480
|
-
}
|
|
481
|
-
.hasField("rumConfig") {
|
|
482
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
483
|
-
}
|
|
440
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
441
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
442
|
+
.hasFieldEqualTo("variant", "")
|
|
484
443
|
.hasFieldEqualTo(
|
|
485
444
|
"additionalConfig",
|
|
486
445
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
487
446
|
)
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
491
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
492
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
447
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
448
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
493
449
|
}
|
|
494
450
|
|
|
495
451
|
// endregion
|
|
@@ -502,8 +458,10 @@ internal class DdSdkTest {
|
|
|
502
458
|
) {
|
|
503
459
|
// Given
|
|
504
460
|
fakeConfiguration = fakeConfiguration.copy(site = null, nativeCrashReportEnabled = true)
|
|
505
|
-
val
|
|
506
|
-
val
|
|
461
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
462
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
463
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
464
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
507
465
|
|
|
508
466
|
// When
|
|
509
467
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -512,42 +470,28 @@ internal class DdSdkTest {
|
|
|
512
470
|
inOrder(mockDatadog) {
|
|
513
471
|
verify(mockDatadog).initialize(
|
|
514
472
|
same(mockContext),
|
|
515
|
-
|
|
516
|
-
configCaptor.capture(),
|
|
473
|
+
sdkConfigCaptor.capture(),
|
|
517
474
|
any()
|
|
518
475
|
)
|
|
519
|
-
verify(mockDatadog).
|
|
476
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
477
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
478
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
520
479
|
}
|
|
521
|
-
assertThat(
|
|
480
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
522
481
|
.hasField("coreConfig") {
|
|
523
482
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
524
483
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
484
|
+
it.hasFieldEqualTo("site", DatadogSite.US1)
|
|
525
485
|
}
|
|
526
|
-
.
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
.hasField("tracesConfig") {
|
|
531
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1.intakeEndpoint)
|
|
532
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
533
|
-
}
|
|
534
|
-
.hasField("rumConfig") {
|
|
535
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1.intakeEndpoint)
|
|
536
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
537
|
-
}
|
|
538
|
-
.hasField("crashReportConfig") {
|
|
539
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1.intakeEndpoint)
|
|
540
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
541
|
-
}
|
|
486
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
487
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
488
|
+
.hasFieldEqualTo("variant", "")
|
|
542
489
|
.hasFieldEqualTo(
|
|
543
490
|
"additionalConfig",
|
|
544
491
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
545
492
|
)
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
549
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
550
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
493
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
494
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
551
495
|
}
|
|
552
496
|
|
|
553
497
|
@Test
|
|
@@ -557,8 +501,10 @@ internal class DdSdkTest {
|
|
|
557
501
|
// Given
|
|
558
502
|
val site = forge.randomizeCase("us1")
|
|
559
503
|
fakeConfiguration = fakeConfiguration.copy(site = site, nativeCrashReportEnabled = true)
|
|
560
|
-
val
|
|
561
|
-
val
|
|
504
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
505
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
506
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
507
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
562
508
|
|
|
563
509
|
// When
|
|
564
510
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -567,42 +513,28 @@ internal class DdSdkTest {
|
|
|
567
513
|
inOrder(mockDatadog) {
|
|
568
514
|
verify(mockDatadog).initialize(
|
|
569
515
|
same(mockContext),
|
|
570
|
-
|
|
571
|
-
configCaptor.capture(),
|
|
516
|
+
sdkConfigCaptor.capture(),
|
|
572
517
|
any()
|
|
573
518
|
)
|
|
574
|
-
verify(mockDatadog).
|
|
519
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
520
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
521
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
575
522
|
}
|
|
576
|
-
assertThat(
|
|
523
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
577
524
|
.hasField("coreConfig") {
|
|
578
525
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
579
526
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
527
|
+
it.hasFieldEqualTo("site", DatadogSite.US1)
|
|
580
528
|
}
|
|
581
|
-
.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
}
|
|
585
|
-
.hasField("tracesConfig") {
|
|
586
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1.intakeEndpoint)
|
|
587
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
588
|
-
}
|
|
589
|
-
.hasField("rumConfig") {
|
|
590
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1.intakeEndpoint)
|
|
591
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
592
|
-
}
|
|
593
|
-
.hasField("crashReportConfig") {
|
|
594
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1.intakeEndpoint)
|
|
595
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
596
|
-
}
|
|
529
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
530
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
531
|
+
.hasFieldEqualTo("variant", "")
|
|
597
532
|
.hasFieldEqualTo(
|
|
598
533
|
"additionalConfig",
|
|
599
534
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
600
535
|
)
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
604
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
605
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
536
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
537
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
606
538
|
}
|
|
607
539
|
|
|
608
540
|
@Test
|
|
@@ -612,8 +544,10 @@ internal class DdSdkTest {
|
|
|
612
544
|
// Given
|
|
613
545
|
val site = forge.randomizeCase("us3")
|
|
614
546
|
fakeConfiguration = fakeConfiguration.copy(site = site, nativeCrashReportEnabled = true)
|
|
615
|
-
val
|
|
616
|
-
val
|
|
547
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
548
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
549
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
550
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
617
551
|
|
|
618
552
|
// When
|
|
619
553
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -622,42 +556,28 @@ internal class DdSdkTest {
|
|
|
622
556
|
inOrder(mockDatadog) {
|
|
623
557
|
verify(mockDatadog).initialize(
|
|
624
558
|
same(mockContext),
|
|
625
|
-
|
|
626
|
-
configCaptor.capture(),
|
|
559
|
+
sdkConfigCaptor.capture(),
|
|
627
560
|
any()
|
|
628
561
|
)
|
|
629
|
-
verify(mockDatadog).
|
|
562
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
563
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
564
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
630
565
|
}
|
|
631
|
-
assertThat(
|
|
566
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
632
567
|
.hasField("coreConfig") {
|
|
633
568
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
634
569
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
570
|
+
it.hasFieldEqualTo("site", DatadogSite.US3)
|
|
635
571
|
}
|
|
636
|
-
.
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}
|
|
640
|
-
.hasField("tracesConfig") {
|
|
641
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US3.intakeEndpoint)
|
|
642
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
643
|
-
}
|
|
644
|
-
.hasField("rumConfig") {
|
|
645
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US3.intakeEndpoint)
|
|
646
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
647
|
-
}
|
|
648
|
-
.hasField("crashReportConfig") {
|
|
649
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US3.intakeEndpoint)
|
|
650
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
651
|
-
}
|
|
572
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
573
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
574
|
+
.hasFieldEqualTo("variant", "")
|
|
652
575
|
.hasFieldEqualTo(
|
|
653
576
|
"additionalConfig",
|
|
654
577
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
655
578
|
)
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
659
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
660
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
579
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
580
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
661
581
|
}
|
|
662
582
|
|
|
663
583
|
@Test
|
|
@@ -667,8 +587,10 @@ internal class DdSdkTest {
|
|
|
667
587
|
// Given
|
|
668
588
|
val site = forge.randomizeCase("us5")
|
|
669
589
|
fakeConfiguration = fakeConfiguration.copy(site = site, nativeCrashReportEnabled = true)
|
|
670
|
-
val
|
|
671
|
-
val
|
|
590
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
591
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
592
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
593
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
672
594
|
|
|
673
595
|
// When
|
|
674
596
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -677,42 +599,28 @@ internal class DdSdkTest {
|
|
|
677
599
|
inOrder(mockDatadog) {
|
|
678
600
|
verify(mockDatadog).initialize(
|
|
679
601
|
same(mockContext),
|
|
680
|
-
|
|
681
|
-
configCaptor.capture(),
|
|
602
|
+
sdkConfigCaptor.capture(),
|
|
682
603
|
any()
|
|
683
604
|
)
|
|
684
|
-
verify(mockDatadog).
|
|
605
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
606
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
607
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
685
608
|
}
|
|
686
|
-
assertThat(
|
|
609
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
687
610
|
.hasField("coreConfig") {
|
|
688
611
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
689
612
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
613
|
+
it.hasFieldEqualTo("site", DatadogSite.US5)
|
|
690
614
|
}
|
|
691
|
-
.
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
.hasField("tracesConfig") {
|
|
696
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US5.intakeEndpoint)
|
|
697
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
698
|
-
}
|
|
699
|
-
.hasField("rumConfig") {
|
|
700
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US5.intakeEndpoint)
|
|
701
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
702
|
-
}
|
|
703
|
-
.hasField("crashReportConfig") {
|
|
704
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US5.intakeEndpoint)
|
|
705
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
706
|
-
}
|
|
615
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
616
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
617
|
+
.hasFieldEqualTo("variant", "")
|
|
707
618
|
.hasFieldEqualTo(
|
|
708
619
|
"additionalConfig",
|
|
709
620
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
710
621
|
)
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
714
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
715
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
622
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
623
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
716
624
|
}
|
|
717
625
|
|
|
718
626
|
@Test
|
|
@@ -722,8 +630,10 @@ internal class DdSdkTest {
|
|
|
722
630
|
// Given
|
|
723
631
|
val site = forge.randomizeCase("us1_fed")
|
|
724
632
|
fakeConfiguration = fakeConfiguration.copy(site = site, nativeCrashReportEnabled = true)
|
|
725
|
-
val
|
|
726
|
-
val
|
|
633
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
634
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
635
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
636
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
727
637
|
|
|
728
638
|
// When
|
|
729
639
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -732,42 +642,28 @@ internal class DdSdkTest {
|
|
|
732
642
|
inOrder(mockDatadog) {
|
|
733
643
|
verify(mockDatadog).initialize(
|
|
734
644
|
same(mockContext),
|
|
735
|
-
|
|
736
|
-
configCaptor.capture(),
|
|
645
|
+
sdkConfigCaptor.capture(),
|
|
737
646
|
any()
|
|
738
647
|
)
|
|
739
|
-
verify(mockDatadog).
|
|
648
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
649
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
650
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
740
651
|
}
|
|
741
|
-
assertThat(
|
|
652
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
742
653
|
.hasField("coreConfig") {
|
|
743
654
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
744
655
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
656
|
+
it.hasFieldEqualTo("site", DatadogSite.US1_FED)
|
|
745
657
|
}
|
|
746
|
-
.
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
}
|
|
750
|
-
.hasField("tracesConfig") {
|
|
751
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1_FED.intakeEndpoint)
|
|
752
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
753
|
-
}
|
|
754
|
-
.hasField("rumConfig") {
|
|
755
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1_FED.intakeEndpoint)
|
|
756
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
757
|
-
}
|
|
758
|
-
.hasField("crashReportConfig") {
|
|
759
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.US1_FED.intakeEndpoint)
|
|
760
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
761
|
-
}
|
|
658
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
659
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
660
|
+
.hasFieldEqualTo("variant", "")
|
|
762
661
|
.hasFieldEqualTo(
|
|
763
662
|
"additionalConfig",
|
|
764
663
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
765
664
|
)
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
769
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
770
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
665
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
666
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
771
667
|
}
|
|
772
668
|
|
|
773
669
|
@Test
|
|
@@ -777,8 +673,10 @@ internal class DdSdkTest {
|
|
|
777
673
|
// Given
|
|
778
674
|
val site = forge.randomizeCase("eu1")
|
|
779
675
|
fakeConfiguration = fakeConfiguration.copy(site = site, nativeCrashReportEnabled = true)
|
|
780
|
-
val
|
|
781
|
-
val
|
|
676
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
677
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
678
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
679
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
782
680
|
|
|
783
681
|
// When
|
|
784
682
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -787,42 +685,28 @@ internal class DdSdkTest {
|
|
|
787
685
|
inOrder(mockDatadog) {
|
|
788
686
|
verify(mockDatadog).initialize(
|
|
789
687
|
same(mockContext),
|
|
790
|
-
|
|
791
|
-
configCaptor.capture(),
|
|
688
|
+
sdkConfigCaptor.capture(),
|
|
792
689
|
any()
|
|
793
690
|
)
|
|
794
|
-
verify(mockDatadog).
|
|
691
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
692
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
693
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
795
694
|
}
|
|
796
|
-
assertThat(
|
|
695
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
797
696
|
.hasField("coreConfig") {
|
|
798
697
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
799
698
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
699
|
+
it.hasFieldEqualTo("site", DatadogSite.EU1)
|
|
800
700
|
}
|
|
801
|
-
.
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
}
|
|
805
|
-
.hasField("tracesConfig") {
|
|
806
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.EU1.intakeEndpoint)
|
|
807
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
808
|
-
}
|
|
809
|
-
.hasField("rumConfig") {
|
|
810
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.EU1.intakeEndpoint)
|
|
811
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
812
|
-
}
|
|
813
|
-
.hasField("crashReportConfig") {
|
|
814
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.EU1.intakeEndpoint)
|
|
815
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
816
|
-
}
|
|
701
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
702
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
703
|
+
.hasFieldEqualTo("variant", "")
|
|
817
704
|
.hasFieldEqualTo(
|
|
818
705
|
"additionalConfig",
|
|
819
706
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
820
707
|
)
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
824
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
825
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
708
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
709
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
826
710
|
}
|
|
827
711
|
|
|
828
712
|
@Test
|
|
@@ -832,8 +716,10 @@ internal class DdSdkTest {
|
|
|
832
716
|
// Given
|
|
833
717
|
val site = forge.randomizeCase("ap1")
|
|
834
718
|
fakeConfiguration = fakeConfiguration.copy(site = site, nativeCrashReportEnabled = true)
|
|
835
|
-
val
|
|
836
|
-
val
|
|
719
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
720
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
721
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
722
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
837
723
|
|
|
838
724
|
// When
|
|
839
725
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -842,42 +728,28 @@ internal class DdSdkTest {
|
|
|
842
728
|
inOrder(mockDatadog) {
|
|
843
729
|
verify(mockDatadog).initialize(
|
|
844
730
|
same(mockContext),
|
|
845
|
-
|
|
846
|
-
configCaptor.capture(),
|
|
731
|
+
sdkConfigCaptor.capture(),
|
|
847
732
|
any()
|
|
848
733
|
)
|
|
849
|
-
verify(mockDatadog).
|
|
734
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
735
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
736
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
850
737
|
}
|
|
851
|
-
assertThat(
|
|
738
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
852
739
|
.hasField("coreConfig") {
|
|
853
740
|
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
854
741
|
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
742
|
+
it.hasFieldEqualTo("site", DatadogSite.AP1)
|
|
855
743
|
}
|
|
856
|
-
.
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
.hasField("tracesConfig") {
|
|
861
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.AP1.intakeEndpoint)
|
|
862
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
863
|
-
}
|
|
864
|
-
.hasField("rumConfig") {
|
|
865
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.AP1.intakeEndpoint)
|
|
866
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
867
|
-
}
|
|
868
|
-
.hasField("crashReportConfig") {
|
|
869
|
-
it.hasFieldEqualTo("endpointUrl", DatadogSite.AP1.intakeEndpoint)
|
|
870
|
-
it.hasFieldEqualTo("plugins", emptyList<DatadogPlugin>())
|
|
871
|
-
}
|
|
744
|
+
.hasFieldEqualTo("clientToken", fakeConfiguration.clientToken)
|
|
745
|
+
.hasFieldEqualTo("env", fakeConfiguration.env)
|
|
746
|
+
.hasFieldEqualTo("variant", "")
|
|
872
747
|
.hasFieldEqualTo(
|
|
873
748
|
"additionalConfig",
|
|
874
749
|
fakeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
875
750
|
)
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
assertThat(credentials.envName).isEqualTo(fakeConfiguration.env)
|
|
879
|
-
assertThat(credentials.rumApplicationId).isEqualTo(fakeConfiguration.applicationId)
|
|
880
|
-
assertThat(credentials.variant).isEqualTo("")
|
|
751
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
752
|
+
.hasFieldEqualTo("applicationId", fakeConfiguration.applicationId)
|
|
881
753
|
}
|
|
882
754
|
|
|
883
755
|
// endregion
|
|
@@ -888,8 +760,10 @@ internal class DdSdkTest {
|
|
|
888
760
|
fun `𝕄 initialize native SDK 𝕎 initialize() {trackingConsent=null}`() {
|
|
889
761
|
// Given
|
|
890
762
|
fakeConfiguration = fakeConfiguration.copy(trackingConsent = null)
|
|
891
|
-
val
|
|
892
|
-
val
|
|
763
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
764
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
765
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
766
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
893
767
|
|
|
894
768
|
// When
|
|
895
769
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -898,11 +772,12 @@ internal class DdSdkTest {
|
|
|
898
772
|
inOrder(mockDatadog) {
|
|
899
773
|
verify(mockDatadog).initialize(
|
|
900
774
|
same(mockContext),
|
|
901
|
-
|
|
902
|
-
configCaptor.capture(),
|
|
775
|
+
sdkConfigCaptor.capture(),
|
|
903
776
|
eq(TrackingConsent.PENDING)
|
|
904
777
|
)
|
|
905
|
-
verify(mockDatadog).
|
|
778
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
779
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
780
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
906
781
|
}
|
|
907
782
|
}
|
|
908
783
|
|
|
@@ -913,8 +788,10 @@ internal class DdSdkTest {
|
|
|
913
788
|
// Given
|
|
914
789
|
val consent = forge.randomizeCase("PENDING")
|
|
915
790
|
fakeConfiguration = fakeConfiguration.copy(trackingConsent = consent)
|
|
916
|
-
val
|
|
917
|
-
val
|
|
791
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
792
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
793
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
794
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
918
795
|
|
|
919
796
|
// When
|
|
920
797
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -923,11 +800,12 @@ internal class DdSdkTest {
|
|
|
923
800
|
inOrder(mockDatadog) {
|
|
924
801
|
verify(mockDatadog).initialize(
|
|
925
802
|
same(mockContext),
|
|
926
|
-
|
|
927
|
-
configCaptor.capture(),
|
|
803
|
+
sdkConfigCaptor.capture(),
|
|
928
804
|
eq(TrackingConsent.PENDING)
|
|
929
805
|
)
|
|
930
|
-
verify(mockDatadog).
|
|
806
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
807
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
808
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
931
809
|
}
|
|
932
810
|
}
|
|
933
811
|
|
|
@@ -938,8 +816,10 @@ internal class DdSdkTest {
|
|
|
938
816
|
// Given
|
|
939
817
|
val consent = forge.randomizeCase("GRANTED")
|
|
940
818
|
fakeConfiguration = fakeConfiguration.copy(trackingConsent = consent)
|
|
941
|
-
val
|
|
942
|
-
val
|
|
819
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
820
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
821
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
822
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
943
823
|
|
|
944
824
|
// When
|
|
945
825
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -948,11 +828,12 @@ internal class DdSdkTest {
|
|
|
948
828
|
inOrder(mockDatadog) {
|
|
949
829
|
verify(mockDatadog).initialize(
|
|
950
830
|
same(mockContext),
|
|
951
|
-
|
|
952
|
-
configCaptor.capture(),
|
|
831
|
+
sdkConfigCaptor.capture(),
|
|
953
832
|
eq(TrackingConsent.GRANTED)
|
|
954
833
|
)
|
|
955
|
-
verify(mockDatadog).
|
|
834
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
835
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
836
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
956
837
|
}
|
|
957
838
|
}
|
|
958
839
|
|
|
@@ -963,8 +844,10 @@ internal class DdSdkTest {
|
|
|
963
844
|
// Given
|
|
964
845
|
val consent = forge.randomizeCase("NOT_GRANTED")
|
|
965
846
|
fakeConfiguration = fakeConfiguration.copy(trackingConsent = consent)
|
|
966
|
-
val
|
|
967
|
-
val
|
|
847
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
848
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
849
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
850
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
968
851
|
|
|
969
852
|
// When
|
|
970
853
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -973,11 +856,12 @@ internal class DdSdkTest {
|
|
|
973
856
|
inOrder(mockDatadog) {
|
|
974
857
|
verify(mockDatadog).initialize(
|
|
975
858
|
same(mockContext),
|
|
976
|
-
|
|
977
|
-
configCaptor.capture(),
|
|
859
|
+
sdkConfigCaptor.capture(),
|
|
978
860
|
eq(TrackingConsent.NOT_GRANTED)
|
|
979
861
|
)
|
|
980
|
-
verify(mockDatadog).
|
|
862
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
863
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
864
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
981
865
|
}
|
|
982
866
|
}
|
|
983
867
|
|
|
@@ -989,8 +873,10 @@ internal class DdSdkTest {
|
|
|
989
873
|
) {
|
|
990
874
|
// Given
|
|
991
875
|
val bridgeConfiguration = configuration.copy(additionalConfig = null)
|
|
992
|
-
val
|
|
993
|
-
val
|
|
876
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
877
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
878
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
879
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
994
880
|
|
|
995
881
|
// When
|
|
996
882
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -999,14 +885,15 @@ internal class DdSdkTest {
|
|
|
999
885
|
inOrder(mockDatadog) {
|
|
1000
886
|
verify(mockDatadog).initialize(
|
|
1001
887
|
same(mockContext),
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
888
|
+
sdkConfigCaptor.capture(),
|
|
889
|
+
any()
|
|
1005
890
|
)
|
|
1006
|
-
verify(mockDatadog).
|
|
891
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
892
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
893
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1007
894
|
}
|
|
1008
|
-
assertThat(
|
|
1009
|
-
.hasField("
|
|
895
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
896
|
+
.hasField("featureConfiguration") {
|
|
1010
897
|
it.hasFieldEqualTo("viewTrackingStrategy", NoOpViewTrackingStrategy)
|
|
1011
898
|
}
|
|
1012
899
|
}
|
|
@@ -1021,8 +908,10 @@ internal class DdSdkTest {
|
|
|
1021
908
|
DdSdkImplementation.DD_NATIVE_VIEW_TRACKING to false
|
|
1022
909
|
)
|
|
1023
910
|
)
|
|
1024
|
-
val
|
|
1025
|
-
val
|
|
911
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
912
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
913
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
914
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1026
915
|
|
|
1027
916
|
// When
|
|
1028
917
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1031,14 +920,15 @@ internal class DdSdkTest {
|
|
|
1031
920
|
inOrder(mockDatadog) {
|
|
1032
921
|
verify(mockDatadog).initialize(
|
|
1033
922
|
same(mockContext),
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
923
|
+
sdkConfigCaptor.capture(),
|
|
924
|
+
any()
|
|
1037
925
|
)
|
|
1038
|
-
verify(mockDatadog).
|
|
926
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
927
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
928
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1039
929
|
}
|
|
1040
|
-
assertThat(
|
|
1041
|
-
.hasField("
|
|
930
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
931
|
+
.hasField("featureConfiguration") {
|
|
1042
932
|
it.hasFieldEqualTo("viewTrackingStrategy", NoOpViewTrackingStrategy)
|
|
1043
933
|
}
|
|
1044
934
|
}
|
|
@@ -1053,8 +943,10 @@ internal class DdSdkTest {
|
|
|
1053
943
|
DdSdkImplementation.DD_NATIVE_VIEW_TRACKING to true
|
|
1054
944
|
)
|
|
1055
945
|
)
|
|
1056
|
-
val
|
|
1057
|
-
val
|
|
946
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
947
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
948
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
949
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1058
950
|
|
|
1059
951
|
// When
|
|
1060
952
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1063,14 +955,15 @@ internal class DdSdkTest {
|
|
|
1063
955
|
inOrder(mockDatadog) {
|
|
1064
956
|
verify(mockDatadog).initialize(
|
|
1065
957
|
same(mockContext),
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
958
|
+
sdkConfigCaptor.capture(),
|
|
959
|
+
any()
|
|
1069
960
|
)
|
|
1070
|
-
verify(mockDatadog).
|
|
961
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
962
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
963
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1071
964
|
}
|
|
1072
|
-
assertThat(
|
|
1073
|
-
.hasField("
|
|
965
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
966
|
+
.hasField("featureConfiguration") {
|
|
1074
967
|
it.hasFieldEqualTo("viewTrackingStrategy", ActivityViewTrackingStrategy(false))
|
|
1075
968
|
}
|
|
1076
969
|
}
|
|
@@ -1085,8 +978,10 @@ internal class DdSdkTest {
|
|
|
1085
978
|
DdSdkImplementation.DD_NATIVE_INTERACTION_TRACKING to false
|
|
1086
979
|
)
|
|
1087
980
|
)
|
|
1088
|
-
val
|
|
1089
|
-
val
|
|
981
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
982
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
983
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
984
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1090
985
|
|
|
1091
986
|
// When
|
|
1092
987
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1095,18 +990,16 @@ internal class DdSdkTest {
|
|
|
1095
990
|
inOrder(mockDatadog) {
|
|
1096
991
|
verify(mockDatadog).initialize(
|
|
1097
992
|
same(mockContext),
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
993
|
+
sdkConfigCaptor.capture(),
|
|
994
|
+
any()
|
|
1101
995
|
)
|
|
1102
|
-
verify(mockDatadog).
|
|
996
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
997
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
998
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1103
999
|
}
|
|
1104
|
-
assertThat(
|
|
1105
|
-
.hasField("
|
|
1106
|
-
it.
|
|
1107
|
-
"userActionTrackingStrategy",
|
|
1108
|
-
"com.datadog.android.rum.internal.tracking.NoOpUserActionTrackingStrategy"
|
|
1109
|
-
)
|
|
1000
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1001
|
+
.hasField("featureConfiguration") {
|
|
1002
|
+
it.hasFieldEqualTo("viewTrackingStrategy", NoOpViewTrackingStrategy)
|
|
1110
1003
|
}
|
|
1111
1004
|
}
|
|
1112
1005
|
|
|
@@ -1118,8 +1011,10 @@ internal class DdSdkTest {
|
|
|
1118
1011
|
val bridgeConfiguration = configuration.copy(
|
|
1119
1012
|
trackFrustrations = true
|
|
1120
1013
|
)
|
|
1121
|
-
val
|
|
1122
|
-
val
|
|
1014
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1015
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1016
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1017
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1123
1018
|
|
|
1124
1019
|
// When
|
|
1125
1020
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1128,18 +1023,16 @@ internal class DdSdkTest {
|
|
|
1128
1023
|
inOrder(mockDatadog) {
|
|
1129
1024
|
verify(mockDatadog).initialize(
|
|
1130
1025
|
same(mockContext),
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1026
|
+
sdkConfigCaptor.capture(),
|
|
1027
|
+
any()
|
|
1134
1028
|
)
|
|
1135
|
-
verify(mockDatadog).
|
|
1029
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1030
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1031
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1136
1032
|
}
|
|
1137
|
-
assertThat(
|
|
1138
|
-
.hasField("
|
|
1139
|
-
it.hasFieldEqualTo(
|
|
1140
|
-
"trackFrustrations",
|
|
1141
|
-
true
|
|
1142
|
-
)
|
|
1033
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1034
|
+
.hasField("featureConfiguration") {
|
|
1035
|
+
it.hasFieldEqualTo("trackFrustrations", true)
|
|
1143
1036
|
}
|
|
1144
1037
|
}
|
|
1145
1038
|
|
|
@@ -1151,8 +1044,10 @@ internal class DdSdkTest {
|
|
|
1151
1044
|
val bridgeConfiguration = configuration.copy(
|
|
1152
1045
|
trackFrustrations = false
|
|
1153
1046
|
)
|
|
1154
|
-
val
|
|
1155
|
-
val
|
|
1047
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1048
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1049
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1050
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1156
1051
|
|
|
1157
1052
|
// When
|
|
1158
1053
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1161,18 +1056,16 @@ internal class DdSdkTest {
|
|
|
1161
1056
|
inOrder(mockDatadog) {
|
|
1162
1057
|
verify(mockDatadog).initialize(
|
|
1163
1058
|
same(mockContext),
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1059
|
+
sdkConfigCaptor.capture(),
|
|
1060
|
+
any()
|
|
1167
1061
|
)
|
|
1168
|
-
verify(mockDatadog).
|
|
1062
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1063
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1064
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1169
1065
|
}
|
|
1170
|
-
assertThat(
|
|
1171
|
-
.hasField("
|
|
1172
|
-
it.hasFieldEqualTo(
|
|
1173
|
-
"trackFrustrations",
|
|
1174
|
-
false
|
|
1175
|
-
)
|
|
1066
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1067
|
+
.hasField("featureConfiguration") {
|
|
1068
|
+
it.hasFieldEqualTo("trackFrustrations", false)
|
|
1176
1069
|
}
|
|
1177
1070
|
}
|
|
1178
1071
|
|
|
@@ -1186,8 +1079,10 @@ internal class DdSdkTest {
|
|
|
1186
1079
|
DdSdkImplementation.DD_NATIVE_INTERACTION_TRACKING to true
|
|
1187
1080
|
)
|
|
1188
1081
|
)
|
|
1189
|
-
val
|
|
1190
|
-
val
|
|
1082
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1083
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1084
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1085
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1191
1086
|
|
|
1192
1087
|
// When
|
|
1193
1088
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1196,19 +1091,16 @@ internal class DdSdkTest {
|
|
|
1196
1091
|
inOrder(mockDatadog) {
|
|
1197
1092
|
verify(mockDatadog).initialize(
|
|
1198
1093
|
same(mockContext),
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
)
|
|
1203
|
-
verify(mockDatadog).
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
"com.datadog.android.rum.internal" +
|
|
1210
|
-
".instrumentation.UserActionTrackingStrategyLegacy"
|
|
1211
|
-
)
|
|
1094
|
+
sdkConfigCaptor.capture(),
|
|
1095
|
+
any()
|
|
1096
|
+
)
|
|
1097
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1098
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1099
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1100
|
+
}
|
|
1101
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1102
|
+
.hasField("featureConfiguration") {
|
|
1103
|
+
it.hasFieldEqualTo("userActionTracking", true)
|
|
1212
1104
|
}
|
|
1213
1105
|
}
|
|
1214
1106
|
|
|
@@ -1222,8 +1114,10 @@ internal class DdSdkTest {
|
|
|
1222
1114
|
DdSdkImplementation.DD_NATIVE_INTERACTION_TRACKING to null
|
|
1223
1115
|
)
|
|
1224
1116
|
)
|
|
1225
|
-
val
|
|
1226
|
-
val
|
|
1117
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1118
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1119
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1120
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1227
1121
|
|
|
1228
1122
|
// When
|
|
1229
1123
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1232,21 +1126,19 @@ internal class DdSdkTest {
|
|
|
1232
1126
|
inOrder(mockDatadog) {
|
|
1233
1127
|
verify(mockDatadog).initialize(
|
|
1234
1128
|
same(mockContext),
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
)
|
|
1239
|
-
verify(mockDatadog).
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
"com.datadog.android.rum.internal" +
|
|
1246
|
-
".instrumentation.UserActionTrackingStrategyLegacy"
|
|
1247
|
-
)
|
|
1129
|
+
sdkConfigCaptor.capture(),
|
|
1130
|
+
any()
|
|
1131
|
+
)
|
|
1132
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1133
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1134
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1135
|
+
}
|
|
1136
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1137
|
+
.hasField("featureConfiguration") {
|
|
1138
|
+
it.hasFieldEqualTo("userActionTracking", true)
|
|
1248
1139
|
}
|
|
1249
1140
|
}
|
|
1141
|
+
|
|
1250
1142
|
@Test
|
|
1251
1143
|
fun `𝕄 initialize native SDK 𝕎 initialize() {sdk verbosity}`(
|
|
1252
1144
|
@Forgery configuration: DdSdkConfiguration,
|
|
@@ -1303,20 +1195,40 @@ internal class DdSdkTest {
|
|
|
1303
1195
|
DdSdkImplementation.DD_SERVICE_NAME to serviceName
|
|
1304
1196
|
)
|
|
1305
1197
|
)
|
|
1306
|
-
val
|
|
1307
|
-
val
|
|
1198
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1199
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1200
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1201
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1308
1202
|
|
|
1309
1203
|
// When
|
|
1310
1204
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1311
1205
|
|
|
1312
1206
|
// Then
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1207
|
+
inOrder(mockDatadog) {
|
|
1208
|
+
verify(mockDatadog).initialize(
|
|
1209
|
+
same(mockContext),
|
|
1210
|
+
sdkConfigCaptor.capture(),
|
|
1211
|
+
any()
|
|
1212
|
+
)
|
|
1213
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1214
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1215
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1216
|
+
}
|
|
1217
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
1218
|
+
.hasField("coreConfig") {
|
|
1219
|
+
it.hasFieldEqualTo("needsClearTextHttp", false)
|
|
1220
|
+
it.hasFieldEqualTo("firstPartyHostsWithHeaderTypes", emptyMap<String, String>())
|
|
1221
|
+
}
|
|
1222
|
+
.hasFieldEqualTo("clientToken", bridgeConfiguration.clientToken)
|
|
1223
|
+
.hasFieldEqualTo("env", bridgeConfiguration.env)
|
|
1224
|
+
.hasFieldEqualTo("variant", "")
|
|
1225
|
+
.hasFieldEqualTo("service", serviceName)
|
|
1226
|
+
.hasFieldEqualTo(
|
|
1227
|
+
"additionalConfig",
|
|
1228
|
+
bridgeConfiguration.additionalConfig?.filterValues { it != null }.orEmpty()
|
|
1229
|
+
)
|
|
1230
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1231
|
+
.hasFieldEqualTo("applicationId", bridgeConfiguration.applicationId)
|
|
1320
1232
|
}
|
|
1321
1233
|
|
|
1322
1234
|
@Test
|
|
@@ -1330,21 +1242,27 @@ internal class DdSdkTest {
|
|
|
1330
1242
|
val bridgeConfiguration = configuration.copy(
|
|
1331
1243
|
nativeLongTaskThresholdMs = threshold
|
|
1332
1244
|
)
|
|
1333
|
-
val
|
|
1334
|
-
val
|
|
1245
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1246
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1247
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1248
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1335
1249
|
|
|
1336
1250
|
// When
|
|
1337
1251
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1338
1252
|
|
|
1339
1253
|
// Then
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
.
|
|
1254
|
+
inOrder(mockDatadog) {
|
|
1255
|
+
verify(mockDatadog).initialize(
|
|
1256
|
+
same(mockContext),
|
|
1257
|
+
sdkConfigCaptor.capture(),
|
|
1258
|
+
any()
|
|
1259
|
+
)
|
|
1260
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1261
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1262
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1263
|
+
}
|
|
1264
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1265
|
+
.hasField("featureConfiguration") { rumConfig ->
|
|
1348
1266
|
rumConfig.hasField("longTaskTrackingStrategy") { longTaskTrackingStrategy ->
|
|
1349
1267
|
longTaskTrackingStrategy
|
|
1350
1268
|
.isInstanceOf(
|
|
@@ -1365,21 +1283,27 @@ internal class DdSdkTest {
|
|
|
1365
1283
|
val bridgeConfiguration = configuration.copy(
|
|
1366
1284
|
nativeLongTaskThresholdMs = 0.0
|
|
1367
1285
|
)
|
|
1368
|
-
val
|
|
1369
|
-
val
|
|
1286
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1287
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1288
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1289
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1370
1290
|
|
|
1371
1291
|
// When
|
|
1372
1292
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1373
1293
|
|
|
1374
1294
|
// Then
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
.
|
|
1295
|
+
inOrder(mockDatadog) {
|
|
1296
|
+
verify(mockDatadog).initialize(
|
|
1297
|
+
same(mockContext),
|
|
1298
|
+
sdkConfigCaptor.capture(),
|
|
1299
|
+
any()
|
|
1300
|
+
)
|
|
1301
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1302
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1303
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1304
|
+
}
|
|
1305
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1306
|
+
.hasField("featureConfiguration") { rumConfig ->
|
|
1383
1307
|
rumConfig.doesNotHaveField("longTaskTrackingStrategy")
|
|
1384
1308
|
}
|
|
1385
1309
|
}
|
|
@@ -1422,19 +1346,26 @@ internal class DdSdkTest {
|
|
|
1422
1346
|
DdSdkImplementation.DD_FIRST_PARTY_HOSTS to firstPartyHosts.toReadableArray()
|
|
1423
1347
|
)
|
|
1424
1348
|
)
|
|
1425
|
-
val
|
|
1349
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1350
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1351
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1352
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1426
1353
|
|
|
1427
1354
|
// When
|
|
1428
1355
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1429
1356
|
|
|
1430
1357
|
// Then
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1358
|
+
inOrder(mockDatadog) {
|
|
1359
|
+
verify(mockDatadog).initialize(
|
|
1360
|
+
same(mockContext),
|
|
1361
|
+
sdkConfigCaptor.capture(),
|
|
1362
|
+
any()
|
|
1363
|
+
)
|
|
1364
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1365
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1366
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1367
|
+
}
|
|
1368
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
1438
1369
|
.hasField("coreConfig") { coreConfig ->
|
|
1439
1370
|
coreConfig.hasFieldEqualTo(
|
|
1440
1371
|
"firstPartyHostsWithHeaderTypes",
|
|
@@ -1452,7 +1383,7 @@ internal class DdSdkTest {
|
|
|
1452
1383
|
Pair(
|
|
1453
1384
|
forge.aStringMatching("[a-z]+\\.[a-z]{3}"),
|
|
1454
1385
|
setOf(
|
|
1455
|
-
TracingHeaderType.DATADOG
|
|
1386
|
+
TracingHeaderType.DATADOG
|
|
1456
1387
|
)
|
|
1457
1388
|
)
|
|
1458
1389
|
}
|
|
@@ -1476,19 +1407,26 @@ internal class DdSdkTest {
|
|
|
1476
1407
|
DdSdkImplementation.DD_FIRST_PARTY_HOSTS to firstPartyHosts.toReadableArray()
|
|
1477
1408
|
)
|
|
1478
1409
|
)
|
|
1479
|
-
val
|
|
1410
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1411
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1412
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1413
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1480
1414
|
|
|
1481
1415
|
// When
|
|
1482
1416
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1483
1417
|
|
|
1484
1418
|
// Then
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1419
|
+
inOrder(mockDatadog) {
|
|
1420
|
+
verify(mockDatadog).initialize(
|
|
1421
|
+
same(mockContext),
|
|
1422
|
+
sdkConfigCaptor.capture(),
|
|
1423
|
+
any()
|
|
1424
|
+
)
|
|
1425
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1426
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1427
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1428
|
+
}
|
|
1429
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
1492
1430
|
.hasField("coreConfig") { coreConfig ->
|
|
1493
1431
|
coreConfig.hasFieldEqualTo(
|
|
1494
1432
|
"firstPartyHostsWithHeaderTypes",
|
|
@@ -1508,9 +1446,9 @@ internal class DdSdkTest {
|
|
|
1508
1446
|
host,
|
|
1509
1447
|
setOf(
|
|
1510
1448
|
TracingHeaderType.DATADOG,
|
|
1511
|
-
TracingHeaderType.B3
|
|
1449
|
+
TracingHeaderType.B3
|
|
1512
1450
|
)
|
|
1513
|
-
)
|
|
1451
|
+
)
|
|
1514
1452
|
)
|
|
1515
1453
|
|
|
1516
1454
|
val firstPartyHosts = mutableListOf<ReadableMap>()
|
|
@@ -1518,7 +1456,7 @@ internal class DdSdkTest {
|
|
|
1518
1456
|
mapOf(
|
|
1519
1457
|
"match" to host,
|
|
1520
1458
|
"propagatorTypes" to listOf(
|
|
1521
|
-
TracingHeaderType.DATADOG.name.lowercase()
|
|
1459
|
+
TracingHeaderType.DATADOG.name.lowercase()
|
|
1522
1460
|
).toReadableArray()
|
|
1523
1461
|
).toReadableMap()
|
|
1524
1462
|
)
|
|
@@ -1526,7 +1464,7 @@ internal class DdSdkTest {
|
|
|
1526
1464
|
mapOf(
|
|
1527
1465
|
"match" to host,
|
|
1528
1466
|
"propagatorTypes" to listOf(
|
|
1529
|
-
TracingHeaderType.B3.name.lowercase()
|
|
1467
|
+
TracingHeaderType.B3.name.lowercase()
|
|
1530
1468
|
).toReadableArray()
|
|
1531
1469
|
).toReadableMap()
|
|
1532
1470
|
)
|
|
@@ -1537,19 +1475,26 @@ internal class DdSdkTest {
|
|
|
1537
1475
|
DdSdkImplementation.DD_FIRST_PARTY_HOSTS to firstPartyHosts.toReadableArray()
|
|
1538
1476
|
)
|
|
1539
1477
|
)
|
|
1540
|
-
val
|
|
1478
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1479
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1480
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1481
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1541
1482
|
|
|
1542
1483
|
// When
|
|
1543
1484
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1544
1485
|
|
|
1545
1486
|
// Then
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1487
|
+
inOrder(mockDatadog) {
|
|
1488
|
+
verify(mockDatadog).initialize(
|
|
1489
|
+
same(mockContext),
|
|
1490
|
+
sdkConfigCaptor.capture(),
|
|
1491
|
+
any()
|
|
1492
|
+
)
|
|
1493
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1494
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1495
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1496
|
+
}
|
|
1497
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
1553
1498
|
.hasField("coreConfig") { coreConfig ->
|
|
1554
1499
|
coreConfig.hasFieldEqualTo(
|
|
1555
1500
|
"firstPartyHostsWithHeaderTypes",
|
|
@@ -1567,10 +1512,12 @@ internal class DdSdkTest {
|
|
|
1567
1512
|
) {
|
|
1568
1513
|
// Given
|
|
1569
1514
|
val bridgeConfiguration = configuration.copy(
|
|
1570
|
-
uploadFrequency = input
|
|
1515
|
+
uploadFrequency = input
|
|
1571
1516
|
)
|
|
1572
|
-
val
|
|
1573
|
-
val
|
|
1517
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1518
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1519
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1520
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1574
1521
|
|
|
1575
1522
|
// When
|
|
1576
1523
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1579,15 +1526,19 @@ internal class DdSdkTest {
|
|
|
1579
1526
|
inOrder(mockDatadog) {
|
|
1580
1527
|
verify(mockDatadog).initialize(
|
|
1581
1528
|
same(mockContext),
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1529
|
+
sdkConfigCaptor.capture(),
|
|
1530
|
+
any()
|
|
1585
1531
|
)
|
|
1586
|
-
verify(mockDatadog).
|
|
1532
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1533
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1534
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1587
1535
|
}
|
|
1588
|
-
assertThat(
|
|
1589
|
-
.hasField("coreConfig") {
|
|
1590
|
-
|
|
1536
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
1537
|
+
.hasField("coreConfig") { coreConfig ->
|
|
1538
|
+
coreConfig.hasFieldEqualTo(
|
|
1539
|
+
"uploadFrequency",
|
|
1540
|
+
expectedUploadFrequency
|
|
1541
|
+
)
|
|
1591
1542
|
}
|
|
1592
1543
|
}
|
|
1593
1544
|
|
|
@@ -1600,10 +1551,12 @@ internal class DdSdkTest {
|
|
|
1600
1551
|
) {
|
|
1601
1552
|
// Given
|
|
1602
1553
|
val bridgeConfiguration = configuration.copy(
|
|
1603
|
-
batchSize = input
|
|
1554
|
+
batchSize = input
|
|
1604
1555
|
)
|
|
1605
|
-
val
|
|
1606
|
-
val
|
|
1556
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1557
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1558
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1559
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1607
1560
|
|
|
1608
1561
|
// When
|
|
1609
1562
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1612,15 +1565,19 @@ internal class DdSdkTest {
|
|
|
1612
1565
|
inOrder(mockDatadog) {
|
|
1613
1566
|
verify(mockDatadog).initialize(
|
|
1614
1567
|
same(mockContext),
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1568
|
+
sdkConfigCaptor.capture(),
|
|
1569
|
+
any()
|
|
1618
1570
|
)
|
|
1619
|
-
verify(mockDatadog).
|
|
1571
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1572
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1573
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1620
1574
|
}
|
|
1621
|
-
assertThat(
|
|
1622
|
-
.hasField("coreConfig") {
|
|
1623
|
-
|
|
1575
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
1576
|
+
.hasField("coreConfig") { coreConfig ->
|
|
1577
|
+
coreConfig.hasFieldEqualTo(
|
|
1578
|
+
"batchSize",
|
|
1579
|
+
expectedBatchSize
|
|
1580
|
+
)
|
|
1624
1581
|
}
|
|
1625
1582
|
}
|
|
1626
1583
|
|
|
@@ -1632,10 +1589,12 @@ internal class DdSdkTest {
|
|
|
1632
1589
|
// Given
|
|
1633
1590
|
val trackBackgroundEvents = forge.aNullable { forge.aBool() }
|
|
1634
1591
|
val bridgeConfiguration = configuration.copy(
|
|
1635
|
-
trackBackgroundEvents = trackBackgroundEvents
|
|
1592
|
+
trackBackgroundEvents = trackBackgroundEvents
|
|
1636
1593
|
)
|
|
1637
|
-
val
|
|
1638
|
-
val
|
|
1594
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1595
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1596
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1597
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1639
1598
|
|
|
1640
1599
|
// When
|
|
1641
1600
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1644,14 +1603,15 @@ internal class DdSdkTest {
|
|
|
1644
1603
|
inOrder(mockDatadog) {
|
|
1645
1604
|
verify(mockDatadog).initialize(
|
|
1646
1605
|
same(mockContext),
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1606
|
+
sdkConfigCaptor.capture(),
|
|
1607
|
+
any()
|
|
1650
1608
|
)
|
|
1651
|
-
verify(mockDatadog).
|
|
1609
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1610
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1611
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1652
1612
|
}
|
|
1653
|
-
assertThat(
|
|
1654
|
-
.hasField("
|
|
1613
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1614
|
+
.hasField("featureConfiguration") {
|
|
1655
1615
|
it.hasFieldEqualTo("backgroundEventTracking", trackBackgroundEvents ?: false)
|
|
1656
1616
|
}
|
|
1657
1617
|
}
|
|
@@ -1664,8 +1624,10 @@ internal class DdSdkTest {
|
|
|
1664
1624
|
val bridgeConfiguration = configuration.copy(
|
|
1665
1625
|
vitalsUpdateFrequency = "RARE"
|
|
1666
1626
|
)
|
|
1667
|
-
val
|
|
1668
|
-
val
|
|
1627
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1628
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1629
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1630
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1669
1631
|
|
|
1670
1632
|
// When
|
|
1671
1633
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1674,14 +1636,15 @@ internal class DdSdkTest {
|
|
|
1674
1636
|
inOrder(mockDatadog) {
|
|
1675
1637
|
verify(mockDatadog).initialize(
|
|
1676
1638
|
same(mockContext),
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1639
|
+
sdkConfigCaptor.capture(),
|
|
1640
|
+
any()
|
|
1680
1641
|
)
|
|
1681
|
-
verify(mockDatadog).
|
|
1642
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1643
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1644
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1682
1645
|
}
|
|
1683
|
-
assertThat(
|
|
1684
|
-
.hasField("
|
|
1646
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1647
|
+
.hasField("featureConfiguration") {
|
|
1685
1648
|
it.hasFieldEqualTo("vitalsMonitorUpdateFrequency", VitalsUpdateFrequency.RARE)
|
|
1686
1649
|
}
|
|
1687
1650
|
argumentCaptor<Choreographer.FrameCallback> {
|
|
@@ -1700,8 +1663,10 @@ internal class DdSdkTest {
|
|
|
1700
1663
|
vitalsUpdateFrequency = "NEVER",
|
|
1701
1664
|
longTaskThresholdMs = 0.0
|
|
1702
1665
|
)
|
|
1703
|
-
val
|
|
1704
|
-
val
|
|
1666
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1667
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1668
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1669
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1705
1670
|
|
|
1706
1671
|
// When
|
|
1707
1672
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
@@ -1710,14 +1675,15 @@ internal class DdSdkTest {
|
|
|
1710
1675
|
inOrder(mockDatadog) {
|
|
1711
1676
|
verify(mockDatadog).initialize(
|
|
1712
1677
|
same(mockContext),
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1678
|
+
sdkConfigCaptor.capture(),
|
|
1679
|
+
any()
|
|
1716
1680
|
)
|
|
1717
|
-
verify(mockDatadog).
|
|
1681
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1682
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1683
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1718
1684
|
}
|
|
1719
|
-
assertThat(
|
|
1720
|
-
.hasField("
|
|
1685
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1686
|
+
.hasField("featureConfiguration") {
|
|
1721
1687
|
it.hasFieldEqualTo("vitalsMonitorUpdateFrequency", VitalsUpdateFrequency.NEVER)
|
|
1722
1688
|
}
|
|
1723
1689
|
verifyZeroInteractions(mockChoreographer)
|
|
@@ -1736,8 +1702,10 @@ internal class DdSdkTest {
|
|
|
1736
1702
|
vitalsUpdateFrequency = fakeFrequency,
|
|
1737
1703
|
longTaskThresholdMs = 0.0
|
|
1738
1704
|
)
|
|
1739
|
-
val
|
|
1740
|
-
val
|
|
1705
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1706
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1707
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1708
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1741
1709
|
val frameDurationNs = threshold + frameDurationOverThreshold
|
|
1742
1710
|
|
|
1743
1711
|
// When
|
|
@@ -1747,14 +1715,15 @@ internal class DdSdkTest {
|
|
|
1747
1715
|
inOrder(mockDatadog) {
|
|
1748
1716
|
verify(mockDatadog).initialize(
|
|
1749
1717
|
same(mockContext),
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
eq(configuration.trackingConsent.asTrackingConsent())
|
|
1718
|
+
sdkConfigCaptor.capture(),
|
|
1719
|
+
any()
|
|
1753
1720
|
)
|
|
1754
|
-
verify(mockDatadog).
|
|
1721
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1722
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1723
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1755
1724
|
}
|
|
1756
|
-
assertThat(
|
|
1757
|
-
.hasField("
|
|
1725
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1726
|
+
.hasField("featureConfiguration") {
|
|
1758
1727
|
it.hasFieldEqualTo("vitalsMonitorUpdateFrequency", VitalsUpdateFrequency.AVERAGE)
|
|
1759
1728
|
}
|
|
1760
1729
|
argumentCaptor<Choreographer.FrameCallback> {
|
|
@@ -1787,7 +1756,7 @@ internal class DdSdkTest {
|
|
|
1787
1756
|
// Given
|
|
1788
1757
|
val bridgeConfiguration = configuration.copy(
|
|
1789
1758
|
vitalsUpdateFrequency = "AVERAGE",
|
|
1790
|
-
longTaskThresholdMs = (threshold / 1_000_000).toDouble()
|
|
1759
|
+
longTaskThresholdMs = (threshold / 1_000_000).toDouble()
|
|
1791
1760
|
)
|
|
1792
1761
|
val frameDurationNs = threshold + frameDurationOverThreshold
|
|
1793
1762
|
|
|
@@ -1824,7 +1793,7 @@ internal class DdSdkTest {
|
|
|
1824
1793
|
// Given
|
|
1825
1794
|
val bridgeConfiguration = configuration.copy(
|
|
1826
1795
|
vitalsUpdateFrequency = "NEVER",
|
|
1827
|
-
longTaskThresholdMs = (threshold / 1_000_000).toDouble()
|
|
1796
|
+
longTaskThresholdMs = (threshold / 1_000_000).toDouble()
|
|
1828
1797
|
)
|
|
1829
1798
|
val frameDurationNs = threshold + frameDurationOverThreshold
|
|
1830
1799
|
|
|
@@ -1866,19 +1835,26 @@ internal class DdSdkTest {
|
|
|
1866
1835
|
DdSdkImplementation.DD_VERSION_SUFFIX to versionSuffix
|
|
1867
1836
|
)
|
|
1868
1837
|
)
|
|
1869
|
-
val
|
|
1838
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1839
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1840
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1841
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1870
1842
|
|
|
1871
1843
|
// When
|
|
1872
1844
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1873
1845
|
|
|
1874
1846
|
// Then
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1847
|
+
inOrder(mockDatadog) {
|
|
1848
|
+
verify(mockDatadog).initialize(
|
|
1849
|
+
same(mockContext),
|
|
1850
|
+
sdkConfigCaptor.capture(),
|
|
1851
|
+
any()
|
|
1852
|
+
)
|
|
1853
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1854
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1855
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1856
|
+
}
|
|
1857
|
+
assertThat(sdkConfigCaptor.firstValue)
|
|
1882
1858
|
.hasFieldEqualTo(
|
|
1883
1859
|
"additionalConfig",
|
|
1884
1860
|
mapOf(
|
|
@@ -1919,22 +1895,31 @@ internal class DdSdkTest {
|
|
|
1919
1895
|
reactNativeVersion = reactNativeVersion
|
|
1920
1896
|
)
|
|
1921
1897
|
)
|
|
1922
|
-
val
|
|
1898
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1899
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1900
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1901
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1923
1902
|
|
|
1924
1903
|
// When
|
|
1925
1904
|
testedBridgeSdk.initialize(bridgeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1926
1905
|
|
|
1927
1906
|
// Then
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
.
|
|
1907
|
+
inOrder(mockDatadog) {
|
|
1908
|
+
verify(mockDatadog).initialize(
|
|
1909
|
+
same(mockContext),
|
|
1910
|
+
sdkConfigCaptor.capture(),
|
|
1911
|
+
any()
|
|
1912
|
+
)
|
|
1913
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1914
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1915
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1916
|
+
}
|
|
1917
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1918
|
+
.hasField("featureConfiguration") {
|
|
1936
1919
|
val configurationMapper = it
|
|
1937
|
-
.getActualValue<EventMapper<TelemetryConfigurationEvent>>(
|
|
1920
|
+
.getActualValue<EventMapper<TelemetryConfigurationEvent>>(
|
|
1921
|
+
"telemetryConfigurationMapper"
|
|
1922
|
+
)
|
|
1938
1923
|
val result = configurationMapper.map(telemetryConfigurationEvent)!!
|
|
1939
1924
|
assertThat(result.telemetry.configuration.trackNativeErrors!!).isEqualTo(
|
|
1940
1925
|
trackNativeErrors
|
|
@@ -1964,25 +1949,32 @@ internal class DdSdkTest {
|
|
|
1964
1949
|
|
|
1965
1950
|
@Test
|
|
1966
1951
|
fun `𝕄 set a resource mapper that does not drop resources 𝕎 initialize() {}`(
|
|
1967
|
-
@Forgery resourceEvent: ResourceEvent
|
|
1952
|
+
@Forgery resourceEvent: ResourceEvent
|
|
1968
1953
|
) {
|
|
1969
1954
|
// Given
|
|
1970
|
-
val
|
|
1955
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1956
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1957
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1958
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1971
1959
|
|
|
1972
1960
|
// When
|
|
1973
1961
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
1974
1962
|
|
|
1975
1963
|
// Then
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
.
|
|
1964
|
+
inOrder(mockDatadog) {
|
|
1965
|
+
verify(mockDatadog).initialize(
|
|
1966
|
+
same(mockContext),
|
|
1967
|
+
sdkConfigCaptor.capture(),
|
|
1968
|
+
any()
|
|
1969
|
+
)
|
|
1970
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
1971
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
1972
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
1973
|
+
}
|
|
1974
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
1975
|
+
.hasField("featureConfiguration") {
|
|
1984
1976
|
val resourceMapper = it
|
|
1985
|
-
.getActualValue<EventMapper<ResourceEvent>>("
|
|
1977
|
+
.getActualValue<EventMapper<ResourceEvent>>("resourceEventMapper")
|
|
1986
1978
|
val notDroppedEvent = resourceMapper.map(resourceEvent)
|
|
1987
1979
|
assertThat(notDroppedEvent).isNotNull
|
|
1988
1980
|
}
|
|
@@ -1990,26 +1982,33 @@ internal class DdSdkTest {
|
|
|
1990
1982
|
|
|
1991
1983
|
@Test
|
|
1992
1984
|
fun `𝕄 set a resource mapper that drops flagged resources 𝕎 initialize() {}`(
|
|
1993
|
-
@Forgery resourceEvent: ResourceEvent
|
|
1985
|
+
@Forgery resourceEvent: ResourceEvent
|
|
1994
1986
|
) {
|
|
1995
1987
|
// Given
|
|
1996
|
-
val
|
|
1988
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
1989
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
1990
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
1991
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
1997
1992
|
resourceEvent.context?.additionalProperties?.put("_dd.resource.drop_resource", true)
|
|
1998
1993
|
|
|
1999
1994
|
// When
|
|
2000
1995
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
2001
1996
|
|
|
2002
1997
|
// Then
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
.
|
|
1998
|
+
inOrder(mockDatadog) {
|
|
1999
|
+
verify(mockDatadog).initialize(
|
|
2000
|
+
same(mockContext),
|
|
2001
|
+
sdkConfigCaptor.capture(),
|
|
2002
|
+
any()
|
|
2003
|
+
)
|
|
2004
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
2005
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
2006
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
2007
|
+
}
|
|
2008
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
2009
|
+
.hasField("featureConfiguration") {
|
|
2011
2010
|
val resourceMapper = it
|
|
2012
|
-
.getActualValue<EventMapper<ResourceEvent>>("
|
|
2011
|
+
.getActualValue<EventMapper<ResourceEvent>>("resourceEventMapper")
|
|
2013
2012
|
val droppedEvent = resourceMapper.map(resourceEvent)
|
|
2014
2013
|
assertThat(droppedEvent).isNull()
|
|
2015
2014
|
}
|
|
@@ -2021,25 +2020,32 @@ internal class DdSdkTest {
|
|
|
2021
2020
|
|
|
2022
2021
|
@Test
|
|
2023
2022
|
fun `𝕄 set a action mapper that does not drop actions 𝕎 initialize() {}`(
|
|
2024
|
-
@Forgery actionEvent: ActionEvent
|
|
2023
|
+
@Forgery actionEvent: ActionEvent
|
|
2025
2024
|
) {
|
|
2026
2025
|
// Given
|
|
2027
|
-
val
|
|
2026
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
2027
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
2028
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
2029
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
2028
2030
|
|
|
2029
2031
|
// When
|
|
2030
2032
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
2031
2033
|
|
|
2032
2034
|
// Then
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
.
|
|
2035
|
+
inOrder(mockDatadog) {
|
|
2036
|
+
verify(mockDatadog).initialize(
|
|
2037
|
+
same(mockContext),
|
|
2038
|
+
sdkConfigCaptor.capture(),
|
|
2039
|
+
any()
|
|
2040
|
+
)
|
|
2041
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
2042
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
2043
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
2044
|
+
}
|
|
2045
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
2046
|
+
.hasField("featureConfiguration") {
|
|
2041
2047
|
val actionMapper = it
|
|
2042
|
-
.getActualValue<EventMapper<ActionEvent>>("
|
|
2048
|
+
.getActualValue<EventMapper<ActionEvent>>("actionEventMapper")
|
|
2043
2049
|
val notDroppedEvent = actionMapper.map(actionEvent)
|
|
2044
2050
|
assertThat(notDroppedEvent).isNotNull
|
|
2045
2051
|
}
|
|
@@ -2047,26 +2053,33 @@ internal class DdSdkTest {
|
|
|
2047
2053
|
|
|
2048
2054
|
@Test
|
|
2049
2055
|
fun `𝕄 set a action mapper that drops flagged actions 𝕎 initialize() {}`(
|
|
2050
|
-
@Forgery actionEvent: ActionEvent
|
|
2056
|
+
@Forgery actionEvent: ActionEvent
|
|
2051
2057
|
) {
|
|
2052
2058
|
// Given
|
|
2053
|
-
val
|
|
2059
|
+
val sdkConfigCaptor = argumentCaptor<Configuration>()
|
|
2060
|
+
val rumConfigCaptor = argumentCaptor<RumConfiguration>()
|
|
2061
|
+
val logsConfigCaptor = argumentCaptor<LogsConfiguration>()
|
|
2062
|
+
val traceConfigCaptor = argumentCaptor<TraceConfiguration>()
|
|
2054
2063
|
actionEvent.context?.additionalProperties?.put("_dd.action.drop_action", true)
|
|
2055
2064
|
|
|
2056
2065
|
// When
|
|
2057
2066
|
testedBridgeSdk.initialize(fakeConfiguration.toReadableJavaOnlyMap(), mockPromise)
|
|
2058
2067
|
|
|
2059
2068
|
// Then
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
.
|
|
2069
|
+
inOrder(mockDatadog) {
|
|
2070
|
+
verify(mockDatadog).initialize(
|
|
2071
|
+
same(mockContext),
|
|
2072
|
+
sdkConfigCaptor.capture(),
|
|
2073
|
+
any()
|
|
2074
|
+
)
|
|
2075
|
+
verify(mockDatadog).enableRum(rumConfigCaptor.capture())
|
|
2076
|
+
verify(mockDatadog).enableTrace(traceConfigCaptor.capture())
|
|
2077
|
+
verify(mockDatadog).enableLogs(logsConfigCaptor.capture())
|
|
2078
|
+
}
|
|
2079
|
+
assertThat(rumConfigCaptor.firstValue)
|
|
2080
|
+
.hasField("featureConfiguration") {
|
|
2068
2081
|
val actionMapper = it
|
|
2069
|
-
.getActualValue<EventMapper<ActionEvent>>("
|
|
2082
|
+
.getActualValue<EventMapper<ActionEvent>>("actionEventMapper")
|
|
2070
2083
|
val droppedEvent = actionMapper.map(actionEvent)
|
|
2071
2084
|
assertThat(droppedEvent).isNull()
|
|
2072
2085
|
}
|
|
@@ -2266,7 +2279,6 @@ internal class DdSdkTest {
|
|
|
2266
2279
|
|
|
2267
2280
|
@Test
|
|
2268
2281
|
fun `𝕄 build Granted consent 𝕎 buildTrackingConsent {granted}`(forge: Forge) {
|
|
2269
|
-
|
|
2270
2282
|
// When
|
|
2271
2283
|
val consent = testedBridgeSdk.buildTrackingConsent(
|
|
2272
2284
|
forge.anElementFrom("granted", "GRANTED")
|
|
@@ -2278,7 +2290,6 @@ internal class DdSdkTest {
|
|
|
2278
2290
|
|
|
2279
2291
|
@Test
|
|
2280
2292
|
fun `𝕄 build Pending consent 𝕎 buildTrackingConsent {pending}`(forge: Forge) {
|
|
2281
|
-
|
|
2282
2293
|
// When
|
|
2283
2294
|
val consent = testedBridgeSdk.buildTrackingConsent(
|
|
2284
2295
|
forge.anElementFrom("pending", "PENDING")
|
|
@@ -2290,7 +2301,6 @@ internal class DdSdkTest {
|
|
|
2290
2301
|
|
|
2291
2302
|
@Test
|
|
2292
2303
|
fun `𝕄 build Granted consent 𝕎 buildTrackingConsent {not_granted}`(forge: Forge) {
|
|
2293
|
-
|
|
2294
2304
|
// When
|
|
2295
2305
|
val consent = testedBridgeSdk.buildTrackingConsent(
|
|
2296
2306
|
forge.anElementFrom("not_granted", "NOT_GRANTED")
|
|
@@ -2302,7 +2312,6 @@ internal class DdSdkTest {
|
|
|
2302
2312
|
|
|
2303
2313
|
@Test
|
|
2304
2314
|
fun `𝕄 build default Pending consent 𝕎 buildTrackingConsent {any}`(forge: Forge) {
|
|
2305
|
-
|
|
2306
2315
|
// When
|
|
2307
2316
|
val consent = testedBridgeSdk.buildTrackingConsent(
|
|
2308
2317
|
forge.anElementFrom(null, "some-type")
|
|
@@ -2314,7 +2323,6 @@ internal class DdSdkTest {
|
|
|
2314
2323
|
|
|
2315
2324
|
@Test
|
|
2316
2325
|
fun `𝕄 call setTrackingConsent 𝕎 setTrackingConsent ()`(forge: Forge) {
|
|
2317
|
-
|
|
2318
2326
|
// Given
|
|
2319
2327
|
val consent = forge.anElementFrom("pending", "granted", "not_granted")
|
|
2320
2328
|
|
|
@@ -2329,7 +2337,6 @@ internal class DdSdkTest {
|
|
|
2329
2337
|
fun `𝕄 not build proxy config 𝕎 no proxy config specified`(
|
|
2330
2338
|
@Forgery configuration: DdSdkConfiguration
|
|
2331
2339
|
) {
|
|
2332
|
-
|
|
2333
2340
|
// Given
|
|
2334
2341
|
val config = configuration.copy(additionalConfig = null)
|
|
2335
2342
|
|
|
@@ -2520,7 +2527,7 @@ internal class DdSdkTest {
|
|
|
2520
2527
|
return Stream.of(
|
|
2521
2528
|
Arguments.of("SMALL", BatchSize.SMALL),
|
|
2522
2529
|
Arguments.of("MEDIUM", BatchSize.MEDIUM),
|
|
2523
|
-
Arguments.of("LARGE", BatchSize.LARGE)
|
|
2530
|
+
Arguments.of("LARGE", BatchSize.LARGE)
|
|
2524
2531
|
)
|
|
2525
2532
|
}
|
|
2526
2533
|
|
|
@@ -2529,7 +2536,7 @@ internal class DdSdkTest {
|
|
|
2529
2536
|
return Stream.of(
|
|
2530
2537
|
Arguments.of("RARE", UploadFrequency.RARE),
|
|
2531
2538
|
Arguments.of("AVERAGE", UploadFrequency.AVERAGE),
|
|
2532
|
-
Arguments.of("FREQUENT", UploadFrequency.FREQUENT)
|
|
2539
|
+
Arguments.of("FREQUENT", UploadFrequency.FREQUENT)
|
|
2533
2540
|
)
|
|
2534
2541
|
}
|
|
2535
2542
|
}
|