Skip to content

Commit

Permalink
test app version override
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Mar 1, 2018
1 parent 9545c4f commit 680e664
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions features/app_version.feature
@@ -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"
@@ -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())
}

}

0 comments on commit 680e664

Please sign in to comment.