diff --git a/src/objective-c/examples/Sample/SampleTests/SampleTests.m b/src/objective-c/examples/Sample/SampleTests/SampleTests.m index 6d6875c2333..ebe09627ed1 100644 --- a/src/objective-c/examples/Sample/SampleTests/SampleTests.m +++ b/src/objective-c/examples/Sample/SampleTests/SampleTests.m @@ -38,7 +38,7 @@ #import #import #import -#import +#import @interface SampleTests : XCTestCase @end @@ -105,15 +105,15 @@ - (void)testSimpleProtoRPC { __weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."]; - __weak XCTestExpectation *expectedResponse = - [self expectationWithDescription:@"Expected response."]; __weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."]; GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide" interface:@"RouteGuide" method:@"GetFeature"]; - RGDPoint *point = [[[[[RGDPointBuilder alloc] init] setLatitude:28E7] setLongitude:-15E7] build]; + RGDPoint *point = [RGDPoint message]; + point.latitude = 28E7; + point.longitude = -15E7; id requestsWriter = [GRXWriter writerWithValue:[point data]]; GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980" @@ -122,11 +122,10 @@ id responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { XCTAssertNotNil(value, @"nil value received as response."); - [response fulfill]; RGDFeature *feature = [RGDFeature parseFromData:value]; XCTAssertEqualObjects(point, feature.location); XCTAssertNotNil(feature.name, @"Response's name is nil."); - [expectedResponse fulfill]; + [response fulfill]; } completionHandler:^(NSError *errorOrNil) { XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil); [completion fulfill];