// // Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // A copy of the License is located at // // http://aws.amazon.com/apache2.0 // // or in the "license" file accompanying this file. This file is distributed // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing // permissions and limitations under the License. // #import #import #import "OCMock.h" #import "AWSTestUtility.h" #import "AWSSNSService.h" static id mockNetworking = nil; @interface AWSGeneralSNSTests : XCTestCase @end @implementation AWSGeneralSNSTests - (void)setUp { [super setUp]; [AWSTestUtility setupFakeCognitoCredentialsProvider]; mockNetworking = OCMClassMock([AWSNetworking class]); AWSTask *errorTask = [AWSTask taskWithError:[NSError errorWithDomain:@"OCMockExpectedNetworkingError" code:8848 userInfo:nil]]; OCMStub([mockNetworking sendRequest:[OCMArg isKindOfClass:[AWSNetworkingRequest class]]]).andReturn(errorTask); } - (void)tearDown { [super tearDown]; } - (void)testConstructors { NSString *key = @"testSNSConstructors"; XCTAssertNotNil([AWSSNS defaultSNS]); XCTAssertEqual([[AWSSNS defaultSNS] class], [AWSSNS class]); XCTAssertNil([AWSSNS SNSForKey:key]); AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionSAEast1 credentialsProvider:[AWSServiceManager defaultServiceManager].defaultServiceConfiguration.credentialsProvider]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; XCTAssertNotNil([AWSSNS SNSForKey:key]); XCTAssertEqual([[AWSSNS SNSForKey:key] class], [AWSSNS class]); XCTAssertEqual([AWSSNS SNSForKey:key].configuration.regionType, AWSRegionSAEast1); [AWSSNS removeSNSForKey:key]; XCTAssertNil([AWSSNS SNSForKey:key]); } - (void)testAddPermission { NSString *key = @"testAddPermission"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] addPermission:[AWSSNSAddPermissionInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testAddPermissionCompletionHandler { NSString *key = @"testAddPermission"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] addPermission:[AWSSNSAddPermissionInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCheckIfPhoneNumberIsOptedOut { NSString *key = @"testCheckIfPhoneNumberIsOptedOut"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] checkIfPhoneNumberIsOptedOut:[AWSSNSCheckIfPhoneNumberIsOptedOutInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCheckIfPhoneNumberIsOptedOutCompletionHandler { NSString *key = @"testCheckIfPhoneNumberIsOptedOut"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] checkIfPhoneNumberIsOptedOut:[AWSSNSCheckIfPhoneNumberIsOptedOutInput new] completionHandler:^(AWSSNSCheckIfPhoneNumberIsOptedOutResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testConfirmSubscription { NSString *key = @"testConfirmSubscription"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] confirmSubscription:[AWSSNSConfirmSubscriptionInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testConfirmSubscriptionCompletionHandler { NSString *key = @"testConfirmSubscription"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] confirmSubscription:[AWSSNSConfirmSubscriptionInput new] completionHandler:^(AWSSNSConfirmSubscriptionResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreatePlatformApplication { NSString *key = @"testCreatePlatformApplication"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] createPlatformApplication:[AWSSNSCreatePlatformApplicationInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreatePlatformApplicationCompletionHandler { NSString *key = @"testCreatePlatformApplication"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] createPlatformApplication:[AWSSNSCreatePlatformApplicationInput new] completionHandler:^(AWSSNSCreatePlatformApplicationResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreatePlatformEndpoint { NSString *key = @"testCreatePlatformEndpoint"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] createPlatformEndpoint:[AWSSNSCreatePlatformEndpointInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreatePlatformEndpointCompletionHandler { NSString *key = @"testCreatePlatformEndpoint"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] createPlatformEndpoint:[AWSSNSCreatePlatformEndpointInput new] completionHandler:^(AWSSNSCreateEndpointResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreateSMSSandboxPhoneNumber { NSString *key = @"testCreateSMSSandboxPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] createSMSSandboxPhoneNumber:[AWSSNSCreateSMSSandboxPhoneNumberInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreateSMSSandboxPhoneNumberCompletionHandler { NSString *key = @"testCreateSMSSandboxPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] createSMSSandboxPhoneNumber:[AWSSNSCreateSMSSandboxPhoneNumberInput new] completionHandler:^(AWSSNSCreateSMSSandboxPhoneNumberResult* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreateTopic { NSString *key = @"testCreateTopic"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] createTopic:[AWSSNSCreateTopicInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testCreateTopicCompletionHandler { NSString *key = @"testCreateTopic"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] createTopic:[AWSSNSCreateTopicInput new] completionHandler:^(AWSSNSCreateTopicResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeleteEndpoint { NSString *key = @"testDeleteEndpoint"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] deleteEndpoint:[AWSSNSDeleteEndpointInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeleteEndpointCompletionHandler { NSString *key = @"testDeleteEndpoint"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] deleteEndpoint:[AWSSNSDeleteEndpointInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeletePlatformApplication { NSString *key = @"testDeletePlatformApplication"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] deletePlatformApplication:[AWSSNSDeletePlatformApplicationInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeletePlatformApplicationCompletionHandler { NSString *key = @"testDeletePlatformApplication"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] deletePlatformApplication:[AWSSNSDeletePlatformApplicationInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeleteSMSSandboxPhoneNumber { NSString *key = @"testDeleteSMSSandboxPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] deleteSMSSandboxPhoneNumber:[AWSSNSDeleteSMSSandboxPhoneNumberInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeleteSMSSandboxPhoneNumberCompletionHandler { NSString *key = @"testDeleteSMSSandboxPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] deleteSMSSandboxPhoneNumber:[AWSSNSDeleteSMSSandboxPhoneNumberInput new] completionHandler:^(AWSSNSDeleteSMSSandboxPhoneNumberResult* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeleteTopic { NSString *key = @"testDeleteTopic"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] deleteTopic:[AWSSNSDeleteTopicInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testDeleteTopicCompletionHandler { NSString *key = @"testDeleteTopic"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] deleteTopic:[AWSSNSDeleteTopicInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetDataProtectionPolicy { NSString *key = @"testGetDataProtectionPolicy"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] getDataProtectionPolicy:[AWSSNSGetDataProtectionPolicyInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetDataProtectionPolicyCompletionHandler { NSString *key = @"testGetDataProtectionPolicy"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] getDataProtectionPolicy:[AWSSNSGetDataProtectionPolicyInput new] completionHandler:^(AWSSNSGetDataProtectionPolicyResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetEndpointAttributes { NSString *key = @"testGetEndpointAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] getEndpointAttributes:[AWSSNSGetEndpointAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetEndpointAttributesCompletionHandler { NSString *key = @"testGetEndpointAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] getEndpointAttributes:[AWSSNSGetEndpointAttributesInput new] completionHandler:^(AWSSNSGetEndpointAttributesResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetPlatformApplicationAttributes { NSString *key = @"testGetPlatformApplicationAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] getPlatformApplicationAttributes:[AWSSNSGetPlatformApplicationAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetPlatformApplicationAttributesCompletionHandler { NSString *key = @"testGetPlatformApplicationAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] getPlatformApplicationAttributes:[AWSSNSGetPlatformApplicationAttributesInput new] completionHandler:^(AWSSNSGetPlatformApplicationAttributesResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetSMSAttributes { NSString *key = @"testGetSMSAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] getSMSAttributes:[AWSSNSGetSMSAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetSMSAttributesCompletionHandler { NSString *key = @"testGetSMSAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] getSMSAttributes:[AWSSNSGetSMSAttributesInput new] completionHandler:^(AWSSNSGetSMSAttributesResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetSMSSandboxAccountStatus { NSString *key = @"testGetSMSSandboxAccountStatus"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] getSMSSandboxAccountStatus:[AWSSNSGetSMSSandboxAccountStatusInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetSMSSandboxAccountStatusCompletionHandler { NSString *key = @"testGetSMSSandboxAccountStatus"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] getSMSSandboxAccountStatus:[AWSSNSGetSMSSandboxAccountStatusInput new] completionHandler:^(AWSSNSGetSMSSandboxAccountStatusResult* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetSubscriptionAttributes { NSString *key = @"testGetSubscriptionAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] getSubscriptionAttributes:[AWSSNSGetSubscriptionAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetSubscriptionAttributesCompletionHandler { NSString *key = @"testGetSubscriptionAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] getSubscriptionAttributes:[AWSSNSGetSubscriptionAttributesInput new] completionHandler:^(AWSSNSGetSubscriptionAttributesResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetTopicAttributes { NSString *key = @"testGetTopicAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] getTopicAttributes:[AWSSNSGetTopicAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testGetTopicAttributesCompletionHandler { NSString *key = @"testGetTopicAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] getTopicAttributes:[AWSSNSGetTopicAttributesInput new] completionHandler:^(AWSSNSGetTopicAttributesResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListEndpointsByPlatformApplication { NSString *key = @"testListEndpointsByPlatformApplication"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listEndpointsByPlatformApplication:[AWSSNSListEndpointsByPlatformApplicationInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListEndpointsByPlatformApplicationCompletionHandler { NSString *key = @"testListEndpointsByPlatformApplication"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listEndpointsByPlatformApplication:[AWSSNSListEndpointsByPlatformApplicationInput new] completionHandler:^(AWSSNSListEndpointsByPlatformApplicationResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListOriginationNumbers { NSString *key = @"testListOriginationNumbers"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listOriginationNumbers:[AWSSNSListOriginationNumbersRequest new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListOriginationNumbersCompletionHandler { NSString *key = @"testListOriginationNumbers"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listOriginationNumbers:[AWSSNSListOriginationNumbersRequest new] completionHandler:^(AWSSNSListOriginationNumbersResult* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListPhoneNumbersOptedOut { NSString *key = @"testListPhoneNumbersOptedOut"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listPhoneNumbersOptedOut:[AWSSNSListPhoneNumbersOptedOutInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListPhoneNumbersOptedOutCompletionHandler { NSString *key = @"testListPhoneNumbersOptedOut"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listPhoneNumbersOptedOut:[AWSSNSListPhoneNumbersOptedOutInput new] completionHandler:^(AWSSNSListPhoneNumbersOptedOutResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListPlatformApplications { NSString *key = @"testListPlatformApplications"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listPlatformApplications:[AWSSNSListPlatformApplicationsInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListPlatformApplicationsCompletionHandler { NSString *key = @"testListPlatformApplications"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listPlatformApplications:[AWSSNSListPlatformApplicationsInput new] completionHandler:^(AWSSNSListPlatformApplicationsResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListSMSSandboxPhoneNumbers { NSString *key = @"testListSMSSandboxPhoneNumbers"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listSMSSandboxPhoneNumbers:[AWSSNSListSMSSandboxPhoneNumbersInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListSMSSandboxPhoneNumbersCompletionHandler { NSString *key = @"testListSMSSandboxPhoneNumbers"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listSMSSandboxPhoneNumbers:[AWSSNSListSMSSandboxPhoneNumbersInput new] completionHandler:^(AWSSNSListSMSSandboxPhoneNumbersResult* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListSubscriptions { NSString *key = @"testListSubscriptions"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listSubscriptions:[AWSSNSListSubscriptionsInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListSubscriptionsCompletionHandler { NSString *key = @"testListSubscriptions"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listSubscriptions:[AWSSNSListSubscriptionsInput new] completionHandler:^(AWSSNSListSubscriptionsResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListSubscriptionsByTopic { NSString *key = @"testListSubscriptionsByTopic"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listSubscriptionsByTopic:[AWSSNSListSubscriptionsByTopicInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListSubscriptionsByTopicCompletionHandler { NSString *key = @"testListSubscriptionsByTopic"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listSubscriptionsByTopic:[AWSSNSListSubscriptionsByTopicInput new] completionHandler:^(AWSSNSListSubscriptionsByTopicResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListTagsForResource { NSString *key = @"testListTagsForResource"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listTagsForResource:[AWSSNSListTagsForResourceRequest new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListTagsForResourceCompletionHandler { NSString *key = @"testListTagsForResource"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listTagsForResource:[AWSSNSListTagsForResourceRequest new] completionHandler:^(AWSSNSListTagsForResourceResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListTopics { NSString *key = @"testListTopics"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] listTopics:[AWSSNSListTopicsInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testListTopicsCompletionHandler { NSString *key = @"testListTopics"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] listTopics:[AWSSNSListTopicsInput new] completionHandler:^(AWSSNSListTopicsResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testOptInPhoneNumber { NSString *key = @"testOptInPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] optInPhoneNumber:[AWSSNSOptInPhoneNumberInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testOptInPhoneNumberCompletionHandler { NSString *key = @"testOptInPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] optInPhoneNumber:[AWSSNSOptInPhoneNumberInput new] completionHandler:^(AWSSNSOptInPhoneNumberResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testPublish { NSString *key = @"testPublish"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] publish:[AWSSNSPublishInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testPublishCompletionHandler { NSString *key = @"testPublish"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] publish:[AWSSNSPublishInput new] completionHandler:^(AWSSNSPublishResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testPublishBatch { NSString *key = @"testPublishBatch"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] publishBatch:[AWSSNSPublishBatchInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testPublishBatchCompletionHandler { NSString *key = @"testPublishBatch"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] publishBatch:[AWSSNSPublishBatchInput new] completionHandler:^(AWSSNSPublishBatchResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testPutDataProtectionPolicy { NSString *key = @"testPutDataProtectionPolicy"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] putDataProtectionPolicy:[AWSSNSPutDataProtectionPolicyInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testPutDataProtectionPolicyCompletionHandler { NSString *key = @"testPutDataProtectionPolicy"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] putDataProtectionPolicy:[AWSSNSPutDataProtectionPolicyInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testRemovePermission { NSString *key = @"testRemovePermission"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] removePermission:[AWSSNSRemovePermissionInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testRemovePermissionCompletionHandler { NSString *key = @"testRemovePermission"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] removePermission:[AWSSNSRemovePermissionInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetEndpointAttributes { NSString *key = @"testSetEndpointAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] setEndpointAttributes:[AWSSNSSetEndpointAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetEndpointAttributesCompletionHandler { NSString *key = @"testSetEndpointAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] setEndpointAttributes:[AWSSNSSetEndpointAttributesInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetPlatformApplicationAttributes { NSString *key = @"testSetPlatformApplicationAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] setPlatformApplicationAttributes:[AWSSNSSetPlatformApplicationAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetPlatformApplicationAttributesCompletionHandler { NSString *key = @"testSetPlatformApplicationAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] setPlatformApplicationAttributes:[AWSSNSSetPlatformApplicationAttributesInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetSMSAttributes { NSString *key = @"testSetSMSAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] setSMSAttributes:[AWSSNSSetSMSAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetSMSAttributesCompletionHandler { NSString *key = @"testSetSMSAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] setSMSAttributes:[AWSSNSSetSMSAttributesInput new] completionHandler:^(AWSSNSSetSMSAttributesResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetSubscriptionAttributes { NSString *key = @"testSetSubscriptionAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] setSubscriptionAttributes:[AWSSNSSetSubscriptionAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetSubscriptionAttributesCompletionHandler { NSString *key = @"testSetSubscriptionAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] setSubscriptionAttributes:[AWSSNSSetSubscriptionAttributesInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetTopicAttributes { NSString *key = @"testSetTopicAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] setTopicAttributes:[AWSSNSSetTopicAttributesInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSetTopicAttributesCompletionHandler { NSString *key = @"testSetTopicAttributes"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] setTopicAttributes:[AWSSNSSetTopicAttributesInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSubscribe { NSString *key = @"testSubscribe"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] subscribe:[AWSSNSSubscribeInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testSubscribeCompletionHandler { NSString *key = @"testSubscribe"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] subscribe:[AWSSNSSubscribeInput new] completionHandler:^(AWSSNSSubscribeResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testTagResource { NSString *key = @"testTagResource"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] tagResource:[AWSSNSTagResourceRequest new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testTagResourceCompletionHandler { NSString *key = @"testTagResource"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] tagResource:[AWSSNSTagResourceRequest new] completionHandler:^(AWSSNSTagResourceResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testUnsubscribe { NSString *key = @"testUnsubscribe"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] unsubscribe:[AWSSNSUnsubscribeInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testUnsubscribeCompletionHandler { NSString *key = @"testUnsubscribe"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] unsubscribe:[AWSSNSUnsubscribeInput new] completionHandler:^(NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testUntagResource { NSString *key = @"testUntagResource"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] untagResource:[AWSSNSUntagResourceRequest new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testUntagResourceCompletionHandler { NSString *key = @"testUntagResource"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] untagResource:[AWSSNSUntagResourceRequest new] completionHandler:^(AWSSNSUntagResourceResponse* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testVerifySMSSandboxPhoneNumber { NSString *key = @"testVerifySMSSandboxPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; [[[[AWSSNS SNSForKey:key] verifySMSSandboxPhoneNumber:[AWSSNSVerifySMSSandboxPhoneNumberInput new]] continueWithBlock:^id(AWSTask *task) { XCTAssertNotNil(task.error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain); XCTAssertEqual(8848, task.error.code); XCTAssertNil(task.result); return nil; }] waitUntilFinished]; OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } - (void)testVerifySMSSandboxPhoneNumberCompletionHandler { NSString *key = @"testVerifySMSSandboxPhoneNumber"; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil]; [AWSSNS registerSNSWithConfiguration:configuration forKey:key]; AWSSNS *awsClient = [AWSSNS SNSForKey:key]; XCTAssertNotNil(awsClient); XCTAssertNotNil(mockNetworking); [awsClient setValue:mockNetworking forKey:@"networking"]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[AWSSNS SNSForKey:key] verifySMSSandboxPhoneNumber:[AWSSNSVerifySMSSandboxPhoneNumberInput new] completionHandler:^(AWSSNSVerifySMSSandboxPhoneNumberResult* _Nullable response, NSError * _Nullable error) { XCTAssertNotNil(error); XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain); XCTAssertEqual(8848, error.code); XCTAssertNil(response); dispatch_semaphore_signal(semaphore); }]; dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC))); OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]); [AWSSNS removeSNSForKey:key]; } @end