Skip to content

Commit

Permalink
Merge 4affb3f into 9545c4f
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Mar 1, 2018
2 parents 9545c4f + 4affb3f commit d0b8d30
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
11 changes: 11 additions & 0 deletions features/auto_filter.feature
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]"
11 changes: 11 additions & 0 deletions features/manual_filter.feature
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"
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())
}

}
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())
}

}

0 comments on commit d0b8d30

Please sign in to comment.