@@ -105,6 +105,25 @@ - (void)testCreateIdentityPoolCompletionHandler {
105
105
[AWSCognitoIdentity removeCognitoIdentityForKey: key];
106
106
}
107
107
108
+ - (void )testCreateIdentityPoolWithSuppliedHeaders {
109
+ AWSServiceConfiguration *configuration = [AWSTestUtility getDefaultServiceConfiguration ];
110
+ configuration.headers = @{@" foo" : @" bar" };
111
+ id key = @" test-with-headers" ;
112
+ [AWSCognitoIdentity registerCognitoIdentityWithConfiguration: configuration forKey: key];
113
+ AWSCognitoIdentity *cognitoIdentity = [AWSCognitoIdentity CognitoIdentityForKey: key];
114
+ NSDictionary *expected = @{@" foo" : @" bar" , @" Content-Type" : @" application/x-amz-json-1.1" };
115
+ XCTAssertEqualObjects (cognitoIdentity.configuration .headers , expected, @" expected provided headers to be included in configuration object" );
116
+ }
117
+
118
+ - (void )testCreateIdentityPoolNoSuppliedHeaders {
119
+ AWSServiceConfiguration *configuration = [AWSTestUtility getDefaultServiceConfiguration ];
120
+ id key = @" test-without-headers" ;
121
+ [AWSCognitoIdentity registerCognitoIdentityWithConfiguration: configuration forKey: key];
122
+ AWSCognitoIdentity *cognitoIdentity = [AWSCognitoIdentity CognitoIdentityForKey: key];
123
+ NSDictionary *expected = @{@" Content-Type" : @" application/x-amz-json-1.1" };
124
+ XCTAssertEqualObjects (cognitoIdentity.configuration .headers , expected, @" expected Content-Type header to be included" );
125
+ }
126
+
108
127
- (void )testDeleteIdentities {
109
128
NSString *key = @" testDeleteIdentities" ;
110
129
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc ] initWithRegion: AWSRegionUSEast1 credentialsProvider: nil ];
0 commit comments