@@ -1801,16 +1801,10 @@ - (void)testRealtimeStreamRequestBody {
1801
1801
}
1802
1802
1803
1803
- (void )testFetchAndActivateRolloutsNotifyInterop {
1804
- id mockNotificationCenter = [OCMockObject mockForClass: [NSNotificationCenter class ]];
1805
- [[mockNotificationCenter expect ] postNotificationName: @" RolloutsStateDidChangeNotification"
1806
- object: [OCMArg any ]
1807
- userInfo: [OCMArg any ]];
1808
- id mockSubscriber = [OCMockObject mockForProtocol: @protocol (FIRRolloutsStateSubscriber)];
1809
- [[mockSubscriber expect ] rolloutsStateDidChange: [OCMArg any ]];
1810
-
1811
- XCTestExpectation *expectation = [self
1812
- expectationWithDescription: [NSString
1813
- stringWithFormat: @" Test rollout update send notification" ]];
1804
+ XCTestExpectation *notificationExpectation =
1805
+ [self expectationForNotification: @" FIRRolloutsStateDidChangeNotification"
1806
+ object: nil
1807
+ handler: nil ];
1814
1808
1815
1809
XCTAssertEqual (_configInstances[RCNTestRCInstanceDefault].lastFetchStatus ,
1816
1810
FIRRemoteConfigFetchStatusNoFetchYet);
@@ -1826,15 +1820,12 @@ - (void)testFetchAndActivateRolloutsNotifyInterop {
1826
1820
XCTAssertGreaterThan (
1827
1821
self->_configInstances [RCNTestRCInstanceDefault].lastFetchTime .timeIntervalSince1970 , 0 ,
1828
1822
@" last fetch time interval should be set." );
1829
- [expectation fulfill ];
1823
+ [notificationExpectation fulfill ];
1830
1824
};
1831
1825
1832
1826
[_configInstances[RCNTestRCInstanceDefault]
1833
1827
fetchAndActivateWithCompletionHandler: fetchAndActivateCompletion];
1834
- [self waitForExpectationsWithTimeout: _expectationTimeout
1835
- handler: ^(NSError *error) {
1836
- XCTAssertNil (error);
1837
- }];
1828
+ [self waitForExpectations: @[ notificationExpectation ] timeout: _expectationTimeout];
1838
1829
}
1839
1830
1840
1831
#pragma mark - Test Helpers
0 commit comments