Skip to content

Commit

Permalink
Merge pull request #276 from bugsnag/improve-report-code-cov
Browse files Browse the repository at this point in the history
Improve code coverage for report + notifier classes
  • Loading branch information
fractalwrench committed Apr 6, 2018
2 parents ac2a1db + 43dd8e2 commit 1d80da4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sdk/src/androidTest/java/com/bugsnag/android/ReportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,26 @@ public void testModifyingGroupingHash() throws JSONException, IOException {
JSONObject event = events.getJSONObject(0);
assertEquals(groupingHash, event.getString("groupingHash"));
}

@Test
public void testModifyReportDetails() throws Exception {
String apiKey = "custom-api-key";
String notifierName = "React Native";
String notifierUrl = "https://bugsnag.com/reactnative";
String notifierVersion = "3.4.5";

report.setApiKey(apiKey);
report.setNotifierName(notifierName);
report.setNotifierURL(notifierUrl);
report.setNotifierVersion(notifierVersion);

JSONObject reportJson = streamableToJson(report);
assertEquals(apiKey, reportJson.getString("apiKey"));

JSONObject notifier = reportJson.getJSONObject("notifier");
assertEquals(notifierName, notifier.getString("name"));
assertEquals(notifierVersion, notifier.getString("version"));
assertEquals(notifierUrl, notifier.getString("url"));
}

}

0 comments on commit 1d80da4

Please sign in to comment.