From 10b260b93056835e92b66cccd92671ea7920485e Mon Sep 17 00:00:00 2001 From: fractalwrench Date: Tue, 23 Jul 2019 16:18:14 +0100 Subject: [PATCH] fix mazerunner scenario --- .../mazerunner/scenarios/CorruptedOldReportScenario.kt | 4 ++-- .../mazerunner/scenarios/CorruptedOldReportScenario.kt | 4 ++-- tests/features/minimal_report.feature | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt b/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt index e1b20ee665..6c0a4464ea 100644 --- a/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt +++ b/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt @@ -19,13 +19,13 @@ internal class CorruptedOldReportScenario(config: Configuration, // create an empty (invalid) file with an old name files.forEach { val dir = File(it.parent) - it.writeText("") + it.writeText("{\"exceptions\":[{\"stacktrace\":[") it.renameTo(File(dir, "1504255147933_683c6b92-b325-4987-80ad-77086509ca1e.json")) } } override fun run() { super.run() - Bugsnag.notify(java.lang.RuntimeException("Test Report")) + Bugsnag.notify(generateException()) } } diff --git a/tests/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt b/tests/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt index e1b20ee665..6c0a4464ea 100644 --- a/tests/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt +++ b/tests/features/fixtures/mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/CorruptedOldReportScenario.kt @@ -19,13 +19,13 @@ internal class CorruptedOldReportScenario(config: Configuration, // create an empty (invalid) file with an old name files.forEach { val dir = File(it.parent) - it.writeText("") + it.writeText("{\"exceptions\":[{\"stacktrace\":[") it.renameTo(File(dir, "1504255147933_683c6b92-b325-4987-80ad-77086509ca1e.json")) } } override fun run() { super.run() - Bugsnag.notify(java.lang.RuntimeException("Test Report")) + Bugsnag.notify(generateException()) } } diff --git a/tests/features/minimal_report.feature b/tests/features/minimal_report.feature index 9756ba6a26..bbc795c80d 100644 --- a/tests/features/minimal_report.feature +++ b/tests/features/minimal_report.feature @@ -5,7 +5,7 @@ Scenario: Minimal error report for a Handled Exception with an empty file And I configure Bugsnag for "EmptyReportScenario" And I wait to receive a request And the request is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier - And the payload field "events.0.exceptions.0.stacktrace" is an array with 0 element + And the payload field "events.0.exceptions.0.stacktrace" is an array with 0 elements And the exception "errorClass" equals "java.lang.RuntimeException" And the event "severity" equals "warning" And the event "unhandled" is false @@ -17,7 +17,7 @@ Scenario: Minimal error report for an Unhandled Exception with a corrupted file And I configure Bugsnag for "CorruptedReportScenario" And I wait to receive a request And the request is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier - And the payload field "events.0.exceptions.0.stacktrace" is an array with 0 element + And the payload field "events.0.exceptions.0.stacktrace" is an array with 0 elements And the exception "errorClass" equals "java.lang.IllegalStateException" And the event "severity" equals "error" And the event "unhandled" is true @@ -29,5 +29,4 @@ Scenario: Minimal error report with old filename And I configure Bugsnag for "CorruptedOldReportScenario" And I wait to receive a request And the request is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier - And the event "unhandled" is false And the event "incomplete" is false