Skip to content

Commit

Permalink
feat(metadata):tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YYChen01988 committed Jan 31, 2024
1 parent b71e94a commit 8d861bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## TBD

### Enhancements

* `bugsnag-plugin-android-exitinfo` now includes `exitReason` and `processImportance` in the `APP` tab on the dashboard
[#1968](https://github.com/bugsnag/bugsnag-android/pull/1968)

### Bug fixes

* Avoid any possibility of multiple conflicting native crash handlers or stack-unwinders running concurrently
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.bugsnag.android
import android.app.ActivityManager
import android.app.ApplicationExitInfo
import android.content.Context
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
Expand Down Expand Up @@ -117,7 +116,7 @@ internal class ExitInfoCallbackTest {
`when`(exitInfo1.reason).thenReturn(ApplicationExitInfo.REASON_UNKNOWN)
`when`(exitInfo1.importance).thenReturn(ActivityManager.RunningAppProcessInfo.REASON_UNKNOWN)
assertTrue(exitInfoCallback.onSend(event))
assertEquals("0", exitInfo1.reason.toString())
assertEquals("0", exitInfo1.importance.toString())
verify(event, times(1)).addMetadata("app", "exitReason", "unknown reason (0)")
verify(event, times(1)).addMetadata("app", "processImportance", "unknown importance (0)")
}
}
6 changes: 3 additions & 3 deletions features/full_tests/usage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Feature: Reporting Errors with usage info
And the event "usage.callbacks.ndkOnError" equals 1
And the event "usage.callbacks.onBreadcrumb" equals 3
And the event "usage.callbacks.onError" equals 2
And the event "usage.callbacks.onSession" equals 2
And the event "usage.callbacks.onSession" equals 3

Scenario: Report an unhandled exception with custom configuration and set callbacks, usage disabled
When I configure the app to run in the "disable-usage" state
Expand Down Expand Up @@ -87,7 +87,7 @@ Feature: Reporting Errors with usage info
And the event "usage.config.maxPersistedSessions" equals 1000
And the event "usage.callbacks.onBreadcrumb" equals 1
And the event "usage.callbacks.onError" equals 2
And the event "usage.callbacks.onSession" equals 4
And the event "usage.callbacks.onSession" equals 5

Scenario: Report a native exception with custom configuration and set callbacks, usage disabled
When I configure the app to run in the "disable-usage" state
Expand Down Expand Up @@ -121,7 +121,7 @@ Feature: Reporting Errors with usage info
And the event "usage.callbacks.ndkOnError" equals 1
And the event "usage.callbacks.onBreadcrumb" equals 1
And the event "usage.callbacks.onError" equals 2
And the event "usage.callbacks.onSession" equals 4
And the event "usage.callbacks.onSession" equals 5
And the event "usage.callbacks.event_set_user" is true
And the event "usage.callbacks.app_set_binary_arch" is true
And the event "usage.callbacks.device_get_model" is true
Expand Down

0 comments on commit 8d861bd

Please sign in to comment.