aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-08-06 23:08:41 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-08-06 23:09:28 -0700
commit631dc004811bb7b046736faff7666db1d379c1fe (patch)
tree4fd2613a1097ca20994061f75bc0a9128a431aa1
parent594ae574ad94476e9913c9cb723d929f09c4b918 (diff)
Exercise GRPCCall+OAuth2 in the tests
-rw-r--r--src/objective-c/tests/GRPCClientTests.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m
index e5d7e43ed9..1c8461c8e6 100644
--- a/src/objective-c/tests/GRPCClientTests.m
+++ b/src/objective-c/tests/GRPCClientTests.m
@@ -35,6 +35,7 @@
#import <XCTest/XCTest.h>
#import <GRPCClient/GRPCCall.h>
+#import <GRPCClient/GRPCCall+OAuth2.h>
#import <GRPCClient/GRPCCall+Tests.h>
#import <ProtoRPC/ProtoMethod.h>
#import <RemoteTest/Messages.pbobjc.h>
@@ -160,7 +161,7 @@ static ProtoMethod *kUnaryCallMethod;
path:kUnaryCallMethod.HTTPPath
requestsWriter:requestsWriter];
- call.requestMetadata[@"Authorization"] = @"Bearer bogusToken";
+ call.oauth2_accessToken = @"bogusToken";
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
XCTFail(@"Received unexpected response: %@", value);
@@ -169,7 +170,7 @@ static ProtoMethod *kUnaryCallMethod;
XCTAssertEqual(errorOrNil.code, 16, @"Finished with unexpected error: %@", errorOrNil);
XCTAssertEqualObjects(call.responseMetadata, errorOrNil.userInfo[kGRPCStatusMetadataKey],
@"Metadata in the NSError object and call object differ.");
- NSString *challengeHeader = call.responseMetadata[@"www-authenticate"];
+ NSString *challengeHeader = call.oauth2_challengeHeader;
XCTAssertGreaterThan(challengeHeader.length, 0,
@"No challenge in response headers %@", call.responseMetadata);
[expectation fulfill];