-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Feature: Android support | ||
|
||
Scenario: Automatic Filter Tracking | ||
When I run "AutoFilterScenario" with the defaults | ||
Then I should receive a request | ||
And the request is a valid for the error reporting API | ||
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
And the exception "message" equals "AutoFilterScenario" | ||
And the event "metaData.custom.foo" equals "hunter2" | ||
And the event "metaData.custom.password" equals "[FILTERED]" | ||
And the event "metaData.user.password" equals "[FILTERED]" |
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,11 @@ | ||
Feature: Android support | ||
|
||
Scenario: Manual Filter Tracking | ||
When I run "ManualFilterScenario" with the defaults | ||
Then I should receive a request | ||
And the request is a valid for the error reporting API | ||
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
And the exception "message" equals "ManualFilterScenario" | ||
And the event "metaData.custom.foo" equals "[FILTERED]" | ||
And the event "metaData.user.foo" equals "[FILTERED]" | ||
And the event "metaData.custom.bar" equals "hunter2" |
21 changes: 21 additions & 0 deletions
21
mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/AutoFilterScenario.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,21 @@ | ||
package com.bugsnag.android.mazerunner.scenarios | ||
|
||
import android.content.Context | ||
import com.bugsnag.android.Bugsnag | ||
import com.bugsnag.android.Configuration | ||
|
||
/** | ||
* Sends a handled exception to Bugsnag, which contains metadata that should be filtered | ||
*/ | ||
internal class AutoFilterScenario(config: Configuration, | ||
context: Context) : Scenario(config, context) { | ||
|
||
override fun run() { | ||
super.run() | ||
Bugsnag.addToTab("user", "password", "hunter2") | ||
Bugsnag.addToTab("custom", "password", "hunter2") | ||
Bugsnag.addToTab("custom", "foo", "hunter2") | ||
Bugsnag.notify(generateException()) | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/ManualFilterScenario.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.bugsnag.android.mazerunner.scenarios | ||
|
||
import android.content.Context | ||
import com.bugsnag.android.Bugsnag | ||
import com.bugsnag.android.Configuration | ||
|
||
/** | ||
* Sends a handled exception to Bugsnag, which contains metadata that should be filtered | ||
*/ | ||
internal class ManualFilterScenario(config: Configuration, | ||
context: Context) : Scenario(config, context) { | ||
|
||
override fun run() { | ||
super.run() | ||
Bugsnag.setFilters("foo") | ||
Bugsnag.addToTab("user", "foo", "hunter2") | ||
Bugsnag.addToTab("custom", "foo", "hunter2") | ||
Bugsnag.addToTab("custom", "bar", "hunter2") | ||
Bugsnag.notify(generateException()) | ||
} | ||
|
||
} |