Skip to content

Commit

Permalink
Merge branch 'add-maze-harness' of https://github.com/bugsnag/bugsnag…
Browse files Browse the repository at this point in the history
…-android into add-maze-harness
  • Loading branch information
fractalwrench committed Mar 13, 2018
2 parents fa48804 + 701e766 commit a407a1d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions features/breadcrumb.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Feature: Android support

Scenario: Test handled Android Exception
When I run "BreadcrumbScenario" with the defaults
Then I should receive a request
And the request is a valid for the error reporting API
And the exception "message" equals "BreadcrumbScenario"
And the event "breadcrumbs" is not null

And the event "breadcrumbs.1.timestamp" is not null
And the event "breadcrumbs.1.name" equals "Another Breadcrumb"
And the event "breadcrumbs.1.type" equals "user"
And the event "breadcrumbs.1.metaData.Foo" equals "Bar"

And the event "breadcrumbs.0.timestamp" is not null
And the event "breadcrumbs.0.name" equals "Hello Breadcrumb!"
And the event "breadcrumbs.0.type" equals "manual"
And the event "breadcrumbs.0.metaData" is not null
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.bugsnag.android.mazerunner.scenarios

import android.content.Context
import com.bugsnag.android.BreadcrumbType
import com.bugsnag.android.Bugsnag
import com.bugsnag.android.Configuration
import java.util.*

/**
* Sends a handled exception to Bugsnag, which includes manual breadcrumbs.
*/
internal class BreadcrumbScenario(config: Configuration,
context: Context) : Scenario(config, context) {

override fun run() {
super.run()
Bugsnag.leaveBreadcrumb("Hello Breadcrumb!")
Bugsnag.leaveBreadcrumb("Another Breadcrumb", BreadcrumbType.USER, Collections.singletonMap("Foo", "Bar"))
Bugsnag.notify(generateException())
}

}

0 comments on commit a407a1d

Please sign in to comment.