Skip to content

Commit

Permalink
add additional scenarios for release stage
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Feb 22, 2018
1 parent e84cd57 commit abac1f9
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
8 changes: 8 additions & 0 deletions features/array_notify_release_stage.feature
@@ -0,0 +1,8 @@
Feature: Android support

Scenario: Notify release stage array
When I run "ArrayNotifyReleaseStageScenario" 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 "ArrayNotifyReleaseStageScenario"
8 changes: 8 additions & 0 deletions features/null_notify_release_stage.feature
@@ -0,0 +1,8 @@
Feature: Android support

Scenario: Notify release stage null
When I run "NullNotifyReleaseStageScenario" 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 "NullNotifyReleaseStageScenario"
5 changes: 5 additions & 0 deletions features/null_release_stage.feature
@@ -0,0 +1,5 @@
Feature: Android support

Scenario: Null release stage
When I run "NullReleaseStageScenario" with the defaults
Then I should receive no requests
@@ -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 notifyReleaseStages is an array.
*/
internal class ArrayNotifyReleaseStageScenario : Scenario() {

override fun run() {
Bugsnag.setReleaseStage("prod")
Bugsnag.setNotifyReleaseStages("dev", "prod")
Bugsnag.notify(generateException())
}

}
@@ -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 notifyReleaseStages is null.
*/
internal class NullNotifyReleaseStageScenario : Scenario() {

override fun run() {
Bugsnag.setReleaseStage("prod")
// Bugsnag.setNotifyReleaseStages()
Bugsnag.notify(generateException())
}

}
@@ -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 null.
*/
internal class NullReleaseStageScenario : Scenario() {

override fun run() {
Bugsnag.setReleaseStage(null)
Bugsnag.setNotifyReleaseStages("prod")
Bugsnag.notify(generateException())
}

}

0 comments on commit abac1f9

Please sign in to comment.