-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add log.debug to send event and handle response (#100)
- Loading branch information
1 parent
656586a
commit 23c485a
Showing
8 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
android/src/test/java/com/amplitude/android/utilities/AndroidLoggerProviderTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.amplitude.android.utilities | ||
|
||
import android.app.Application | ||
import com.amplitude.android.Amplitude | ||
import com.amplitude.android.Configuration | ||
import io.mockk.mockk | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
|
||
class AndroidLoggerProviderTest { | ||
@Test | ||
fun androidLoggerProvider_getLogger_returnsSingletonInstance() { | ||
val testApiKey = "test-123" | ||
val context = mockk<Application>(relaxed = true) | ||
|
||
val amplitude = Amplitude(Configuration(testApiKey, context = context!!)) | ||
val loggerProvider = AndroidLoggerProvider() | ||
val logger1 = loggerProvider.getLogger(amplitude) | ||
val logger2 = loggerProvider.getLogger(amplitude) | ||
Assertions.assertEquals(logger1, logger2) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
core/src/test/kotlin/com/amplitude/core/utilities/ConsoleLoggerProviderTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.amplitude.core.utilities | ||
|
||
import com.amplitude.core.Configuration | ||
import com.amplitude.core.utils.testAmplitude | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
|
||
class ConsoleLoggerProviderTest { | ||
@Test | ||
fun `test singleton instance`() { | ||
val testApiKey = "test-123" | ||
val amplitude = testAmplitude(Configuration(testApiKey)) | ||
val loggerProvider = ConsoleLoggerProvider() | ||
val logger1 = loggerProvider.getLogger(amplitude) | ||
val logger2 = loggerProvider.getLogger(amplitude) | ||
Assertions.assertEquals(logger1, logger2) | ||
} | ||
} |