Skip to content

Commit

Permalink
add user callback override scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Feb 22, 2018
1 parent 7e188b6 commit e38562a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions features/user_callback.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: Android support

Scenario: User callback override
When I run "UserCallbackScenario" with the defaults
Then I should receive a request
And the request is a valid for the error reporting API
And the exception "message" equals "UserCallbackScenario"
And the event "user.id" equals "Agent Pink"
And the event "user.email" equals "bob@example.com"
And the event "user.name" equals "Zebedee"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.bugsnag.android.mazerunner.scenarios

import com.bugsnag.android.Bugsnag

/**
* Sends a handled exception to Bugsnag, which overrides the default user via a callback
*/
internal class UserCallbackScenario : Scenario() {

override fun run() {
Bugsnag.setUser("abc", "user@example.com", "Jake")
Bugsnag.notify(generateException(), {
it.error?.setUser("Agent Pink", "bob@example.com", "Zebedee")
})
}

}

0 comments on commit e38562a

Please sign in to comment.