// // Copyright Amazon.com Inc. or its affiliates. // All Rights Reserved. // // SPDX-License-Identifier: Apache-2.0 // import Foundation import Combine @testable import Amplify @testable import AmplifyTestCommon @testable import AWSPluginsCore @testable import AWSDataStorePlugin class MockModelReconciliationQueue: ModelReconciliationQueue { public static var mockModelReconciliationQueues: [String: MockModelReconciliationQueue] = [:] private let modelSchema: ModelSchema let modelReconciliationQueueSubject: PassthroughSubject var publisher: AnyPublisher { return modelReconciliationQueueSubject.eraseToAnyPublisher() } init(modelSchema: ModelSchema, storageAdapter: StorageEngineAdapter?, api: APICategoryGraphQLBehavior, reconcileAndSaveQueue: ReconcileAndSaveOperationQueue, modelPredicate: QueryPredicate?, auth: AuthCategoryBehavior?, authModeStrategy: AuthModeStrategy, incomingSubscriptionEvents: IncomingSubscriptionEventPublisher? = nil) { self.modelReconciliationQueueSubject = PassthroughSubject() self.modelSchema = modelSchema MockModelReconciliationQueue.mockModelReconciliationQueues[modelSchema.name] = self } func start() { // no-op } func pause() { // no-op } func cancel() { // no-op } func enqueue(_ remoteModels: [MutationSync]) { // no-op } static func reset() { MockModelReconciliationQueue.mockModelReconciliationQueues = [:] } }