Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud-elmorabea committed Dec 31, 2024
1 parent b866762 commit 9001b8b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,25 @@ internal class TrackingMigrationProcessor(
val deleteDeviceEvent = TrackEvent(
event = EventNames.DEVICE_DELETE,
properties = buildJsonObject {
put(DEVICE_PAYLOAD_JSON_KEY, buildJsonObject {
put(DEVICE_TOKEN_PAYLOAD_JSON_KEY, oldDeviceToken)
put(DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE)
})
put(
DEVICE_PAYLOAD_JSON_KEY,
buildJsonObject {
put(DEVICE_TOKEN_PAYLOAD_JSON_KEY, oldDeviceToken)
put(DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE)
}
)
}
)
analytics.process(deleteDeviceEvent) { event ->
event?.putInContextUnderKey(
DEVICE_PAYLOAD_JSON_KEY,
DEVICE_TOKEN_PAYLOAD_JSON_KEY, oldDeviceToken
DEVICE_TOKEN_PAYLOAD_JSON_KEY,
oldDeviceToken
)
event?.putInContextUnderKey(
DEVICE_PAYLOAD_JSON_KEY,
DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE
DEVICE_TYPE_PAYLOAD_JSON_KEY,
DEVICE_TYPE_PAYLOAD_JSON_VALUE
)
}
}
Expand Down Expand Up @@ -185,20 +190,25 @@ internal class TrackingMigrationProcessor(
event = EventNames.DEVICE_UPDATE,
properties = buildJsonObject {
putAll(task.attributes.toJsonObject())
put(DEVICE_PAYLOAD_JSON_KEY, buildJsonObject {
put(DEVICE_TOKEN_PAYLOAD_JSON_KEY, task.token)
put(DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE)
})
put(
DEVICE_PAYLOAD_JSON_KEY,
buildJsonObject {
put(DEVICE_TOKEN_PAYLOAD_JSON_KEY, task.token)
put(DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE)
}
)
}
),
enrichmentClosure = { event ->
event?.putInContextUnderKey(
DEVICE_PAYLOAD_JSON_KEY,
DEVICE_TOKEN_PAYLOAD_JSON_KEY, task.token
DEVICE_TOKEN_PAYLOAD_JSON_KEY,
task.token
)
event?.putInContextUnderKey(
DEVICE_PAYLOAD_JSON_KEY,
DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE
DEVICE_TYPE_PAYLOAD_JSON_KEY,
DEVICE_TYPE_PAYLOAD_JSON_VALUE
)
}
)
Expand All @@ -207,20 +217,25 @@ internal class TrackingMigrationProcessor(
trackEvent = TrackEvent(
event = EventNames.DEVICE_DELETE,
properties = buildJsonObject {
put(DEVICE_PAYLOAD_JSON_KEY, buildJsonObject {
put(DEVICE_TOKEN_PAYLOAD_JSON_KEY, task.token)
put(DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE)
})
put(
DEVICE_PAYLOAD_JSON_KEY,
buildJsonObject {
put(DEVICE_TOKEN_PAYLOAD_JSON_KEY, task.token)
put(DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE)
}
)
}
),
enrichmentClosure = { event ->
event?.putInContextUnderKey(
DEVICE_PAYLOAD_JSON_KEY,
DEVICE_TOKEN_PAYLOAD_JSON_KEY, task.token
DEVICE_TOKEN_PAYLOAD_JSON_KEY,
task.token
)
event?.putInContextUnderKey(
DEVICE_PAYLOAD_JSON_KEY,
DEVICE_TYPE_PAYLOAD_JSON_KEY, DEVICE_TYPE_PAYLOAD_JSON_VALUE
DEVICE_TYPE_PAYLOAD_JSON_KEY,
DEVICE_TYPE_PAYLOAD_JSON_VALUE
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,13 @@ class TrackingMigrationProcessorTest : IntegrationTest() {
deviceUpdateEvent.event shouldBeEqualTo EventNames.DEVICE_UPDATE
deviceUpdateEvent.context.deviceToken shouldBeEqualTo givenTask.token
deviceUpdateEvent.properties shouldBeEqualTo buildJsonObject {
put("device", buildJsonObject {
put("token", givenTask.token)
put("type", "android")
})
put(
"device",
buildJsonObject {
put("token", givenTask.token)
put("type", "android")
}
)
}
}

Expand Down Expand Up @@ -428,10 +431,13 @@ class TrackingMigrationProcessorTest : IntegrationTest() {
deviceUpdateEvent.context.deviceToken shouldBeEqualTo givenTask.token
deviceUpdateEvent.properties shouldBeEqualTo buildJsonObject {
putAll(givenAttributes.toJsonObject())
put("device", buildJsonObject {
put("token", givenTask.token)
put("type", "android")
})
put(
"device",
buildJsonObject {
put("token", givenTask.token)
put("type", "android")
}
)
}
}

Expand All @@ -451,10 +457,13 @@ class TrackingMigrationProcessorTest : IntegrationTest() {
deviceDeleteEvent.event shouldBeEqualTo EventNames.DEVICE_DELETE
deviceDeleteEvent.context.deviceToken shouldBeEqualTo givenTask.token
deviceDeleteEvent.properties shouldBeEqualTo buildJsonObject {
put("device", buildJsonObject {
put("token", givenTask.token)
put("type", "android")
})
put(
"device",
buildJsonObject {
put("token", givenTask.token)
put("type", "android")
}
)
}
}

Expand Down

0 comments on commit 9001b8b

Please sign in to comment.