Skip to content

Commit

Permalink
PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Nov 12, 2024
1 parent 328f249 commit 00800f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/MessagingPush/RichPush/RichPushHttpClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class RichPushHttpClient: HttpClient {
[cioApiSession, publicSession]
}

private var region: Region = .US
private let region: Region

public func request(_ params: CioInternalCommon.HttpRequestParams, onComplete: @escaping (Result<Data, CioInternalCommon.HttpRequestError>) -> Void) {
httpRequestRunner
Expand Down
5 changes: 5 additions & 0 deletions Tests/MessagingPush/HttpClientTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ class HttpClientTest: UnitTest {
XCTAssertTrue(containsAuthorizationHeader)
}

func test_getDefaultApiHost_givenRegion_expectCorrectApiHost() {
XCTAssertEqual(RichPushHttpClient.getDefaultApiHost(region: .US), "https://cdp.customer.io/v1")
XCTAssertEqual(RichPushHttpClient.getDefaultApiHost(region: .EU), "https://cdp-eu.customer.io/v1")
}

func test_getSessionForRequest_givenCIOAssetLibraryEndpoint_expectPublicSession() {
let actualSession = client.getSessionForRequest(url: URL(string: "https://storage.googleapis.com/cio-asset-manager-standalone/1670599791846_frederick_adoption_day.jpg")!)

Expand Down

0 comments on commit 00800f3

Please sign in to comment.