diff --git a/GliaWidgets/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator.Environment.Mock.swift b/GliaWidgets/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator.Environment.Mock.swift index 2dd0e9e0c..3a0878983 100644 --- a/GliaWidgets/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator.Environment.Mock.swift +++ b/GliaWidgets/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator.Environment.Mock.swift @@ -44,7 +44,7 @@ extension EngagementCoordinator.Environment { }, flipCameraButtonStyle: .nop, alertManager: .mock(), - queuesMonitor: .mock + queuesMonitor: .mock() ) } #endif diff --git a/GliaWidgets/Sources/GliaEnvironment/Glia.Environment.Mock.swift b/GliaWidgets/Sources/GliaEnvironment/Glia.Environment.Mock.swift index c8b7fef4f..31955a5b6 100644 --- a/GliaWidgets/Sources/GliaEnvironment/Glia.Environment.Mock.swift +++ b/GliaWidgets/Sources/GliaEnvironment/Glia.Environment.Mock.swift @@ -34,7 +34,7 @@ extension Glia.Environment { snackBar: .mock, processInfo: .mock(), cameraDeviceManager: { .mock }, - queuesMonitor: .mock, + queuesMonitor: .mock(), isAuthenticated: { false } ) } diff --git a/GliaWidgets/Sources/Interactor/Interactor.Environment.Mock.swift b/GliaWidgets/Sources/Interactor/Interactor.Environment.Mock.swift index ca115dbba..c6dbe7186 100644 --- a/GliaWidgets/Sources/Interactor/Interactor.Environment.Mock.swift +++ b/GliaWidgets/Sources/Interactor/Interactor.Environment.Mock.swift @@ -2,7 +2,7 @@ extension Interactor.Environment { static let mock = Self( coreSdk: .mock, - queuesMonitor: .mock, + queuesMonitor: .mock(), gcd: .mock, log: .mock ) diff --git a/GliaWidgets/Sources/QueuesMonitor/QueuesMonitor.Mock.swift b/GliaWidgets/Sources/QueuesMonitor/QueuesMonitor.Mock.swift index 592235886..01d9e94a3 100644 --- a/GliaWidgets/Sources/QueuesMonitor/QueuesMonitor.Mock.swift +++ b/GliaWidgets/Sources/QueuesMonitor/QueuesMonitor.Mock.swift @@ -1,9 +1,5 @@ #if DEBUG extension QueuesMonitor { - static var mock: Self { - mock() - } - static func mock( listQueues: CoreSdkClient.ListQueues? = nil, subscribeForQueuesUpdates: CoreSdkClient.SubscribeForQueuesUpdates? = nil, diff --git a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+GVA.swift b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+GVA.swift index 3ebf6eb0d..919030070 100644 --- a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+GVA.swift +++ b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+GVA.swift @@ -152,7 +152,7 @@ extension SecureConversationsTranscriptModelTests { listQueues: modelEnv.listQueues, isAuthenticated: { true }, log: logger, - queuesMonitor: .mock + queuesMonitor: .mock() ) let viewModel = TranscriptModel( @@ -198,7 +198,7 @@ private extension SecureConversationsTranscriptModelTests { listQueues: modelEnv.listQueues, isAuthenticated: { true }, log: logger, - queuesMonitor: .mock + queuesMonitor: .mock() ) return TranscriptModel( diff --git a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+MessageRetry.swift b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+MessageRetry.swift index 1124b68dd..b9cd0840a 100644 --- a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+MessageRetry.swift +++ b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+MessageRetry.swift @@ -139,7 +139,7 @@ private extension SecureConversationsTranscriptModelTests { listQueues: modelEnv.listQueues, isAuthenticated: { true }, log: logger, - queuesMonitor: .mock + queuesMonitor: .mock() ) return TranscriptModel( diff --git a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+ResponseCard.swift b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+ResponseCard.swift index 0547da33d..a9938949b 100644 --- a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+ResponseCard.swift +++ b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+ResponseCard.swift @@ -47,7 +47,7 @@ private extension SecureConversationsTranscriptModelTests { listQueues: modelEnv.listQueues, isAuthenticated: { true }, log: logger, - queuesMonitor: .mock + queuesMonitor: .mock() ) return TranscriptModel( diff --git a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+URLs.swift b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+URLs.swift index fae149843..8e164e046 100644 --- a/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+URLs.swift +++ b/GliaWidgetsTests/SecureConversations/ChatTranscript/TranscriptModelTests+URLs.swift @@ -91,7 +91,7 @@ private extension SecureConversationsTranscriptModelTests { listQueues: modelEnv.listQueues, isAuthenticated: { true }, log: logger, - queuesMonitor: .mock + queuesMonitor: .mock() ) return TranscriptModel( diff --git a/GliaWidgetsTests/SecureConversations/Coordinator/SecureConversations.Coordinator.Environment.Mock.swift b/GliaWidgetsTests/SecureConversations/Coordinator/SecureConversations.Coordinator.Environment.Mock.swift index 687dc4404..80b6c0d31 100644 --- a/GliaWidgetsTests/SecureConversations/Coordinator/SecureConversations.Coordinator.Environment.Mock.swift +++ b/GliaWidgetsTests/SecureConversations/Coordinator/SecureConversations.Coordinator.Environment.Mock.swift @@ -53,6 +53,6 @@ extension SecureConversations.Coordinator.Environment { cameraDeviceManager: { .mock }, flipCameraButtonStyle: .nop, alertManager: .mock(), - queuesMonitor: .mock + queuesMonitor: .mock() ) } diff --git a/GliaWidgetsTests/SecureConversations/Welcome/SecureConversations.WelcomeViewModel.Mock.swift b/GliaWidgetsTests/SecureConversations/Welcome/SecureConversations.WelcomeViewModel.Mock.swift index 73b546783..086e3ce7d 100644 --- a/GliaWidgetsTests/SecureConversations/Welcome/SecureConversations.WelcomeViewModel.Mock.swift +++ b/GliaWidgetsTests/SecureConversations/Welcome/SecureConversations.WelcomeViewModel.Mock.swift @@ -53,7 +53,7 @@ extension SecureConversations.Availability { listQueues: { _ in }, isAuthenticated: { true }, log: .mock, - queuesMonitor: .mock + queuesMonitor: .mock() ) ) } diff --git a/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift b/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift index d033ea6c9..28280f8ba 100644 --- a/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift +++ b/GliaWidgetsTests/Sources/ChatViewModel/ChatViewModelTests.swift @@ -239,7 +239,7 @@ class ChatViewModelTests: XCTestCase { // Given enum Calls { case fetchSiteConfigurations } var calls: [Calls] = [] - let interactorEnv = Interactor.Environment(coreSdk: .failing, queuesMonitor: .mock, gcd: .mock, log: .mock) + let interactorEnv = Interactor.Environment(coreSdk: .failing, queuesMonitor: .mock(), gcd: .mock, log: .mock) let interactor = Interactor.mock(environment: interactorEnv) var viewModelEnv = ChatViewModel.Environment.failing() viewModelEnv.fileManager.urlsForDirectoryInDomainMask = { _, _ in [.mock] } @@ -261,7 +261,7 @@ class ChatViewModelTests: XCTestCase { // Given enum Calls { case fetchSiteConfigurations } var calls: [Calls] = [] - var interactorEnv = Interactor.Environment.init(coreSdk: .failing, queuesMonitor: .mock, gcd: .mock, log: .mock) + var interactorEnv = Interactor.Environment.init(coreSdk: .failing, queuesMonitor: .mock(), gcd: .mock, log: .mock) var interactorLog = CoreSdkClient.Logger.failing interactorLog.infoClosure = { _, _, _, _ in } interactorLog.prefixedClosure = { _ in interactorLog } @@ -457,7 +457,7 @@ class ChatViewModelTests: XCTestCase { listQueues: transcriptModelEnv.listQueues, isAuthenticated: { true }, log: logger, - queuesMonitor: .mock + queuesMonitor: .mock() ) let transcriptModel = TranscriptModel( isCustomCardSupported: false, diff --git a/GliaWidgetsTests/Sources/Coordinators/Chat/ChatCoordinator.Environment.Mock.swift b/GliaWidgetsTests/Sources/Coordinators/Chat/ChatCoordinator.Environment.Mock.swift index 83ede8029..8360a6cd7 100644 --- a/GliaWidgetsTests/Sources/Coordinators/Chat/ChatCoordinator.Environment.Mock.swift +++ b/GliaWidgetsTests/Sources/Coordinators/Chat/ChatCoordinator.Environment.Mock.swift @@ -42,6 +42,6 @@ extension ChatCoordinator.Environment { cameraDeviceManager: { .mock }, flipCameraButtonStyle: .nop, alertManager: .mock(), - queuesMonitor: .mock + queuesMonitor: .mock() ) } diff --git a/GliaWidgetsTests/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator+SurveyTests.swift b/GliaWidgetsTests/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator+SurveyTests.swift index 07724bdf6..1656927c6 100644 --- a/GliaWidgetsTests/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator+SurveyTests.swift +++ b/GliaWidgetsTests/Sources/Coordinators/EngagementCoordinator/EngagementCoordinator+SurveyTests.swift @@ -13,7 +13,7 @@ class EngagementCoordinatorSurveyTests: XCTestCase { }, mediaStreams: .init(audio: .none, video: .oneWay) ) - let interactor = Interactor.mock(environment: .init(coreSdk: coreSdkClient, queuesMonitor: .mock, gcd: .failing, log: .failing)) + let interactor = Interactor.mock(environment: .init(coreSdk: coreSdkClient, queuesMonitor: .mock(), gcd: .failing, log: .failing)) interactor.currentEngagement = engagement var alertManagerEnv = AlertManager.Environment.failing() var log = CoreSdkClient.Logger.failing diff --git a/GliaWidgetsTests/Sources/Glia/GliaTests+EngagementLauncher.swift b/GliaWidgetsTests/Sources/Glia/GliaTests+EngagementLauncher.swift index 479dc7a74..d40cbf50d 100644 --- a/GliaWidgetsTests/Sources/Glia/GliaTests+EngagementLauncher.swift +++ b/GliaWidgetsTests/Sources/Glia/GliaTests+EngagementLauncher.swift @@ -96,7 +96,7 @@ private extension GliaTests { completion(.success(())) } sdkEnv.coreSdk.getCurrentEngagement = { nil } - sdkEnv.queuesMonitor = .mock + sdkEnv.queuesMonitor = .mock() let window = UIWindow(frame: .zero) window.makeKeyAndVisible() sdkEnv.uiApplication.windows = { [window] } diff --git a/GliaWidgetsTests/Sources/Glia/GliaTests+StartEngagement.swift b/GliaWidgetsTests/Sources/Glia/GliaTests+StartEngagement.swift index 7711d7663..57e8c98b6 100644 --- a/GliaWidgetsTests/Sources/Glia/GliaTests+StartEngagement.swift +++ b/GliaWidgetsTests/Sources/Glia/GliaTests+StartEngagement.swift @@ -27,7 +27,7 @@ extension GliaTests { sdkEnv.coreSDKConfigurator.configureWithConfiguration = { _, completion in completion(.success(())) } - sdkEnv.queuesMonitor = .mock + sdkEnv.queuesMonitor = .mock() let window = UIWindow(frame: .zero) window.makeKeyAndVisible() sdkEnv.uiApplication.windows = { [window] } @@ -61,7 +61,7 @@ extension GliaTests { } environment.coreSdk.localeProvider.getRemoteString = { _ in nil } environment.coreSDKConfigurator.configureWithInteractor = { _ in } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() let rootCoordinator = EngagementCoordinator.mock( engagementKind: .chat, @@ -104,7 +104,7 @@ extension GliaTests { sdk.environment.coreSDKConfigurator.configureWithConfiguration = { _, completion in completion(.success(())) } - sdk.environment.queuesMonitor = .mock + sdk.environment.queuesMonitor = .mock() try sdk.configure( with: .mock(), theme: .mock() @@ -138,7 +138,7 @@ extension GliaTests { } environment.coreSdk.localeProvider.getRemoteString = { _ in nil } environment.coreSdk.getCurrentEngagement = { nil } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() let sdk = Glia(environment: environment) try sdk.configure( with: .mock(), @@ -179,7 +179,7 @@ extension GliaTests { environment.createRootCoordinator = { _, _, _, _, _, _, _ in .mock(environment: .engagementCoordEnvironmentWithKeyWindow) } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() let sdk = Glia(environment: environment) try sdk.start(.chat, configuration: .mock(), queueID: "queueId", theme: .mock()) @@ -219,7 +219,7 @@ extension GliaTests { } environment.coreSDKConfigurator.configureWithInteractor = { _ in } environment.coreSdk.localeProvider.getRemoteString = { _ in nil } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() let sdk = Glia(environment: environment) @@ -267,7 +267,7 @@ extension GliaTests { } environment.coreSDKConfigurator.configureWithInteractor = { _ in } environment.coreSdk.getCurrentEngagement = { nil } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() var logger = CoreSdkClient.Logger.failing logger.configureLocalLogLevelClosure = { _ in } logger.configureRemoteLogLevelClosure = { _ in } @@ -308,7 +308,7 @@ extension GliaTests { logger.infoClosure = { _, _, _, _ in } logger.prefixedClosure = { _ in logger } environment.coreSdk.createLogger = { _ in logger } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() var resultingViewFactory: ViewFactory? @@ -360,7 +360,7 @@ extension GliaTests { logger.prefixedClosure = { _ in logger } environment.coreSdk.createLogger = { _ in logger } environment.print = .mock - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() var resultingViewFactory: ViewFactory? environment.createRootCoordinator = { _, viewFactory, _, _, _, _, _ in @@ -410,7 +410,7 @@ extension GliaTests { environment.coreSdk.createLogger = { _ in logger } environment.print = .mock environment.conditionalCompilation.isDebug = { true } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() var resultingViewFactory: ViewFactory? @@ -434,7 +434,7 @@ extension GliaTests { } environment.coreSDKConfigurator.configureWithInteractor = { _ in } environment.coreSdk.getCurrentEngagement = { nil } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() let sdk = Glia(environment: environment) @@ -468,7 +468,7 @@ extension GliaTests { environment.coreSdk.createLogger = { _ in logger } environment.print = .mock environment.conditionalCompilation.isDebug = { true } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() var resultingViewFactory: ViewFactory? diff --git a/GliaWidgetsTests/Sources/Glia/GliaTests.swift b/GliaWidgetsTests/Sources/Glia/GliaTests.swift index 22b842cc5..f42204502 100644 --- a/GliaWidgetsTests/Sources/Glia/GliaTests.swift +++ b/GliaWidgetsTests/Sources/Glia/GliaTests.swift @@ -92,7 +92,7 @@ final class GliaTests: XCTestCase { gliaEnv.coreSdk.fetchSiteConfigurations = { _ in } gliaEnv.uuid = { .mock } gliaEnv.gcd.mainQueue.async = { callback in callback() } - gliaEnv.queuesMonitor = .mock + gliaEnv.queuesMonitor = .mock() let expectedTheme = Theme.mock( colorStyle: .custom(.init()), @@ -604,7 +604,7 @@ final class GliaTests: XCTestCase { var engCoordEnvironment = EngagementCoordinator.Environment.engagementCoordEnvironmentWithKeyWindow engCoordEnvironment.fileManager = .mock environment.createRootCoordinator = { _, _, _, _, _, _, _ in EngagementCoordinator.mock(environment: engCoordEnvironment) } - environment.queuesMonitor = .mock + environment.queuesMonitor = .mock() let sdk = Glia(environment: environment) enum Call { diff --git a/GliaWidgetsTests/Sources/InteractorTests.swift b/GliaWidgetsTests/Sources/InteractorTests.swift index 324e56d1c..0bd8a29b4 100644 --- a/GliaWidgetsTests/Sources/InteractorTests.swift +++ b/GliaWidgetsTests/Sources/InteractorTests.swift @@ -28,7 +28,7 @@ class InteractorTests: XCTestCase { coreSdkCalls.append(.queueForEngagement) } - var interactorEnv = Interactor.Environment(coreSdk: coreSdk, queuesMonitor: .mock, gcd: .failing, log: .failing) + var interactorEnv = Interactor.Environment(coreSdk: coreSdk, queuesMonitor: .mock(), gcd: .failing, log: .failing) interactorEnv.log.infoClosure = { _, _, _, _ in } interactorEnv.log.prefixedClosure = { _ in interactorEnv.log } @@ -55,7 +55,7 @@ class InteractorTests: XCTestCase { interactor = .init( visitorContext: nil, - environment: .init(coreSdk: .failing, queuesMonitor: .mock, gcd: .mock, log: .failing) + environment: .init(coreSdk: .failing, queuesMonitor: .mock(), gcd: .mock, log: .failing) ) interactor.addObserver(self, handler: { event in