diff --git a/features/array_notify_release_stage.feature b/features/array_notify_release_stage.feature new file mode 100644 index 0000000000..083c8f7649 --- /dev/null +++ b/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" diff --git a/features/null_notify_release_stage.feature b/features/null_notify_release_stage.feature new file mode 100644 index 0000000000..d09899046e --- /dev/null +++ b/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" diff --git a/features/null_release_stage.feature b/features/null_release_stage.feature new file mode 100644 index 0000000000..d5450c3f7d --- /dev/null +++ b/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 diff --git a/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/ArrayNotifyReleaseStageScenario.kt b/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/ArrayNotifyReleaseStageScenario.kt new file mode 100644 index 0000000000..152f64d9f1 --- /dev/null +++ b/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/ArrayNotifyReleaseStageScenario.kt @@ -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()) + } + +} diff --git a/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/NullNotifyReleaseStageScenario.kt b/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/NullNotifyReleaseStageScenario.kt new file mode 100644 index 0000000000..8bd925e655 --- /dev/null +++ b/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/NullNotifyReleaseStageScenario.kt @@ -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()) + } + +} diff --git a/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/NullReleaseStageScenario.kt b/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/NullReleaseStageScenario.kt new file mode 100644 index 0000000000..a77372f950 --- /dev/null +++ b/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/NullReleaseStageScenario.kt @@ -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()) + } + +}