Skip to content

Commit

Permalink
chore(android): reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
abhaysood committed Aug 1, 2024
1 parent 791558e commit 5e30f59
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ internal class SessionManagerImpl(
processInfo.getPid(),
timeProvider.currentTimeSinceEpochInMillis,
needsReporting = needsReporting,
)
),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal class BatchCreatorImpl(
batchId = batchId,
eventIds = eventIds,
createdAt = timeProvider.currentTimeSinceEpochInMillis,
)
),
)
if (!batchInsertionResult) {
logger.log(LogLevel.Error, "Failed to insert batched event IDs")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ internal data class BatchEntity(
val batchId: String,
val eventIds: List<String>,
val createdAt: Long,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SessionManagerTest {
processInfo.getPid(),
timeProvider.fakeCurrentTimeSinceEpochInMillis,
false,
)
),
)
}

Expand Down Expand Up @@ -91,7 +91,7 @@ class SessionManagerTest {
processInfo.getPid(),
timeProvider.fakeCurrentTimeSinceEpochInMillis,
false,
)
),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ internal class EventExporterTest {
fun `deletes the batch, events and attachments on client error`() {
`when`(
networkClient.execute(
any(), any(), any()
)
any(),
any(),
any(),
),
).thenReturn(HttpResponse.Error.ClientError())
val attachment1 = AttachmentEntity("attachment1", "type", "name", "path")
val attachmentPath = getPathForAttachment(attachment1)
Expand Down Expand Up @@ -228,7 +230,7 @@ internal class EventExporterTest {
batchId = batchId,
eventIds = eventIds,
createdAt = 12345,
)
),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class DatabaseTest {

// when
val result = database.insertBatch(
BatchEntity("batch-id", listOf(event1.id, event2.id), 1234567890L)
BatchEntity("batch-id", listOf(event1.id, event2.id), 1234567890L),
)

// then
Expand All @@ -194,7 +194,7 @@ class DatabaseTest {
"batch-id",
listOf("valid-id", "event-id", "event-id"),
987654321L,
)
),
)
queryAllEventBatches().use {
assertEquals(0, it.count)
Expand All @@ -213,7 +213,7 @@ class DatabaseTest {

// when
val result = database.insertBatch(
BatchEntity("batch-id", listOf(event1.id, eventNotInEventsTable.id), 1234567890L)
BatchEntity("batch-id", listOf(event1.id, eventNotInEventsTable.id), 1234567890L),
)
assertEquals(false, result)
queryAllEventBatches().use {
Expand All @@ -233,7 +233,7 @@ class DatabaseTest {
database.insertEvent(event2)
database.insertEvent(batchedEvent)
database.insertBatch(
TestData.getEventBatchEntity(batchId = "batch-id", eventIds = listOf(batchedEvent.id))
TestData.getEventBatchEntity(batchId = "batch-id", eventIds = listOf(batchedEvent.id)),
)

// when
Expand All @@ -251,14 +251,14 @@ class DatabaseTest {
database.insertSession(
TestData.getSessionEntity(
id = "session-id-1",
needsReporting = true
)
needsReporting = true,
),
)
database.insertSession(
TestData.getSessionEntity(
id = "session-id-2",
needsReporting = false
)
needsReporting = false,
),
)
database.insertEvent(event1)
database.insertEvent(event2)
Expand All @@ -276,14 +276,14 @@ class DatabaseTest {
database.insertSession(
TestData.getSessionEntity(
id = "session-id-1",
needsReporting = true
)
needsReporting = true,
),
)
database.insertSession(
TestData.getSessionEntity(
id = "session-id-2",
needsReporting = false
)
needsReporting = false,
),
)
database.insertEvent(event1)
database.insertEvent(event2)
Expand Down Expand Up @@ -320,14 +320,14 @@ class DatabaseTest {
database.insertSession(
TestData.getSessionEntity(
id = "session-id-1",
needsReporting = false
)
needsReporting = false,
),
)
database.insertSession(
TestData.getSessionEntity(
id = "session-id-2",
needsReporting = false
)
needsReporting = false,
),
)
database.insertEvent(hotLaunchEvent)
database.insertEvent(coldLaunchEvent)
Expand Down Expand Up @@ -360,14 +360,14 @@ class DatabaseTest {
database.insertSession(
TestData.getSessionEntity(
id = "session-id-1",
needsReporting = true
)
needsReporting = true,
),
)
database.insertSession(
TestData.getSessionEntity(
id = "session-id-2",
needsReporting = true
)
needsReporting = true,
),
)
database.insertEvent(event1)
database.insertEvent(event2)
Expand Down Expand Up @@ -456,7 +456,7 @@ class DatabaseTest {
eventWithAttachment.id,
eventWithMultipleAttachments.id,
eventWithDifferentSession.id,
)
),
)

// then
Expand Down Expand Up @@ -564,7 +564,6 @@ class DatabaseTest {
assertNull(sessionId)
}


@Test
fun `getOldestSession returns null when no session exists`() {
// when
Expand Down

0 comments on commit 5e30f59

Please sign in to comment.