-
Notifications
You must be signed in to change notification settings - Fork 205
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
c28a4ae
commit e84cd57
Showing
4 changed files
with
49 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: Inside release stage | ||
When I run "InsideReleaseStageScenario" 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 payload field "notifier.name" equals "Android Bugsnag Notifier" | ||
And the payload field "events" is an array with 1 element | ||
And the exception "errorClass" equals "java.lang.RuntimeException" | ||
And the exception "message" equals "InsideReleaseStageScenario" |
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,5 @@ | ||
Feature: Android support | ||
|
||
Scenario: Outside release stage | ||
When I run "OutsideReleaseStageScenario" with the defaults | ||
Then I should receive no requests |
16 changes: 16 additions & 0 deletions
16
...nner/src/main/java/com/bugsnag/android/mazerunner/scenarios/InsideReleaseStageScenario.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,16 @@ | ||
package com.bugsnag.android.mazerunner.scenarios | ||
|
||
import com.bugsnag.android.Bugsnag | ||
|
||
/** | ||
* Attempts to send a handled exception to Bugsnag, when the release stage is set. | ||
*/ | ||
internal class InsideReleaseStageScenario : Scenario() { | ||
|
||
override fun run() { | ||
Bugsnag.setReleaseStage("prod") | ||
Bugsnag.setNotifyReleaseStages("prod") | ||
Bugsnag.notify(RuntimeException("InsideReleaseStageScenario")) | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...ner/src/main/java/com/bugsnag/android/mazerunner/scenarios/OutsideReleaseStageScenario.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,17 @@ | ||
package com.bugsnag.android.mazerunner.scenarios | ||
|
||
import com.bugsnag.android.Bugsnag | ||
|
||
/** | ||
* Attempts to send a handled exception to Bugsnag, when the release stage is not included. | ||
* This should result in no operation. | ||
*/ | ||
internal class OutsideReleaseStageScenario : Scenario() { | ||
|
||
override fun run() { | ||
Bugsnag.setReleaseStage("prod") | ||
Bugsnag.setNotifyReleaseStages("dev") | ||
Bugsnag.notify(RuntimeException("OutsideReleaseStageScenario")) | ||
} | ||
|
||
} |