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
1 parent
9545c4f
commit 680e664
Showing
2 changed files
with
28 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,9 @@ | ||
Feature: Android support | ||
|
||
Scenario: Test handled Android Exception | ||
When I run "AppVersionScenario" with the defaults | ||
Then I should receive a request | ||
And the request is a valid for the error reporting API | ||
And the exception "errorClass" equals "java.lang.RuntimeException" | ||
And the exception "message" equals "AppVersionScenario" | ||
And the event "app.version" equals "1.2.3.abc" |
19 changes: 19 additions & 0 deletions
19
mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/AppVersionScenario.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,19 @@ | ||
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 overrides the app version | ||
*/ | ||
internal class AppVersionScenario(config: Configuration, | ||
context: Context) : Scenario(config, context) { | ||
|
||
override fun run() { | ||
super.run() | ||
Bugsnag.setAppVersion("1.2.3.abc") | ||
Bugsnag.notify(generateException()) | ||
} | ||
|
||
} |