Skip to content

Commit

Permalink
docs: note that overriding endpoints is for test purposes only
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Jun 20, 2018
1 parent 8bd994f commit d05198d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Tests/BugsnagConfigurationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ - (void)testSessionEndpoints {
// Default endpoints
XCTAssertEqualObjects([NSURL URLWithString:@"https://sessions.bugsnag.com"], config.sessionURL);

// Setting an endpoint
// Test overriding the session endpoint (use dummy endpoints to avoid hitting production)
[config setEndpointsForNotify:@"http://localhost:1234" sessions:@"http://localhost:8000"];
XCTAssertEqualObjects([NSURL URLWithString:@"http://localhost:8000"], config.sessionURL);
}

- (void)testNotifyEndpoint {
BugsnagConfiguration *config = [BugsnagConfiguration new];
XCTAssertEqualObjects([NSURL URLWithString:@"https://notify.bugsnag.com/"], config.notifyURL);

// Test overriding the notify endpoint (use dummy endpoints to avoid hitting production)
[config setEndpointsForNotify:@"http://localhost:1234" sessions:@"http://localhost:8000"];
XCTAssertEqualObjects([NSURL URLWithString:@"http://localhost:1234"], config.notifyURL);
}
Expand Down
4 changes: 3 additions & 1 deletion Tests/BugsnagSinkTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ - (void)setUp {
config.autoNotify = NO;
config.apiKey = @"apiKeyHere";
config.releaseStage = @"MagicalTestingTime";
[config setEndpointsForNotify:@"http://localhost:8000" sessions:@"http://localhost:8000"];

// set a dummy endpoint, avoid hitting production
[config setEndpointsForNotify:@"http://localhost:1234" sessions:@"http://localhost:1234"];
[Bugsnag startBugsnagWithConfiguration:config];
BugsnagCrashReport *report =
[[BugsnagCrashReport alloc] initWithKSReport:self.rawReportData];
Expand Down

0 comments on commit d05198d

Please sign in to comment.