Skip to content

Commit

Permalink
tests: fix appId for test
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweii committed Apr 12, 2024
1 parent 6a99f27 commit a6b48eb
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AnalyticsClientTest: XCTestCase {
override func setUp() async throws {
UserDefaults.standard.removePersistentDomain(forName: Bundle.main.bundleIdentifier!)
let contextConfiguration = ClickstreamConfiguration.getDefaultConfiguration()
.withAppId(testAppId)
.withAppId(testAppId + UUID().uuidString)
.withEndpoint(testEndpoint)
.withSendEventInterval(10_000)
.withTrackAppExceptionEvents(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AutoRecordEventClientTest: XCTestCase {
activityTracker = MockActivityTracker()

let contextConfiguration = ClickstreamConfiguration.getDefaultConfiguration()
.withAppId(testAppId)
.withAppId(testAppId + UUID().uuidString)
.withEndpoint(testEndpoint)
.withSendEventInterval(10_000)
.withTrackAppExceptionEvents(true)
Expand Down
2 changes: 1 addition & 1 deletion Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class EventRecorderTest: XCTestCase {
return HttpResponse.ok(.text("request success"))
}
try! server.start()
let appId = testAppId + String(describing: Date().millisecondsSince1970)
let appId = testAppId + UUID().uuidString

let contextConfiguration = ClickstreamConfiguration.getDefaultConfiguration()
.withAppId(appId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SessionClientTests: XCTestCase {
mockNetworkMonitor = MockNetworkMonitor()

let contextConfiguration = ClickstreamConfiguration.getDefaultConfiguration()
.withAppId(testAppId)
.withAppId(testAppId + UUID().uuidString)
.withEndpoint(testEndpoint)
.withSendEventInterval(10_000)
.withTrackAppExceptionEvents(false)
Expand Down
4 changes: 2 additions & 2 deletions Tests/ClickstreamTests/ClickstreamPluginTestBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ClickstreamPluginTestBase: XCTestCase {
analyticsPlugin = AWSClickstreamPlugin()

let contextConfiguration = ClickstreamConfiguration.getDefaultConfiguration()
.withAppId(testAppId)
.withAppId(testAppId + UUID().uuidString)
.withEndpoint(testEndpoint)
.withSendEventInterval(10_000)
.withTrackAppExceptionEvents(false)
Expand All @@ -34,7 +34,7 @@ class ClickstreamPluginTestBase: XCTestCase {
let eventRecorder = try EventRecorder(clickstream: clickstream)
let analyticsClient = try AnalyticsClient(clickstream: clickstream,
eventRecorder: eventRecorder,
sessionClient: sessionClient )
sessionClient: sessionClient)
analyticsPlugin.analyticsClient = analyticsClient
clickstream.analyticsClient = analyticsClient
clickstream.networkMonitor = mockNetworkMonitor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ClickstreamDBUtiltest: XCTestCase {

override func setUp() {
do {
let appId = testAppId + String(describing: Date().millisecondsSince1970)
let appId = testAppId + UUID().uuidString
dbAdapter = try BaseDBAdapter(prefixPath: EventRecorder.Constants.dbPathPrefix,
databaseName: appId)
dbUtil = ClickstreamDBUtil(dbAdapter: dbAdapter)
Expand Down
2 changes: 1 addition & 1 deletion Tests/ClickstreamTests/IntegrationTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IntegrationTest: XCTestCase {
}
try! server.start()
await Amplify.reset()
let appId = "testAppId" + String(describing: Date().millisecondsSince1970)
let appId = "testAppId" + UUID().uuidString
let configure = ClickstreamConfiguration.getDefaultConfiguration()
.withAppId(appId)
.withEndpoint("http://localhost:8080/collect")
Expand Down

0 comments on commit a6b48eb

Please sign in to comment.