-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #428 from bugsnag/project-packages-fix
fix: prevent overwriting config.projectPackages if already set
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 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
26 changes: 26 additions & 0 deletions
26
sdk/src/androidTest/java/com/bugsnag/android/ProjectPackagesTest.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,26 @@ | ||
package com.bugsnag.android | ||
|
||
import android.support.test.InstrumentationRegistry | ||
import org.junit.Assert.assertArrayEquals | ||
import org.junit.Assert.assertNull | ||
import org.junit.Test | ||
|
||
class ProjectPackagesTest { | ||
|
||
@Test | ||
fun testDefaultProjectPackages() { | ||
val configuration = Configuration("api-key") | ||
assertNull(configuration.projectPackages) | ||
|
||
val client = Client(InstrumentationRegistry.getContext(), configuration) | ||
assertArrayEquals(arrayOf("com.bugsnag.android.test"), client.config.projectPackages) | ||
} | ||
|
||
@Test | ||
fun testProjectPackagesOverride() { | ||
val configuration = Configuration("api-key") | ||
configuration.projectPackages = arrayOf("com.foo.example") | ||
val client = Client(InstrumentationRegistry.getContext(), configuration) | ||
assertArrayEquals(arrayOf("com.foo.example"), client.config.projectPackages) | ||
} | ||
} |
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