2525
2626#import < XCTest/XCTest.h>
2727#import < UIKit/UIKit.h>
28- #import < OHHTTPStubs/OHHTTPStubs .h>
29- #import < OHHTTPStubs/OHPathHelpers .h>
28+ #import < OHHTTPStubs/HTTPStubs .h>
29+ #import < OHHTTPStubs/HTTPStubsPathHelpers .h>
3030#import " LeanplumHelper.h"
3131#import " LeanplumRequest+Categories.h"
3232#import " LPNetworkEngine+Category.h"
@@ -54,7 +54,7 @@ - (void)tearDown
5454 [super tearDown ];
5555 // Clean up after every test.
5656 [LeanplumHelper clean_up ];
57- [OHHTTPStubs removeAllStubs ];
57+ [HTTPStubs removeAllStubs ];
5858
5959}
6060
@@ -63,11 +63,11 @@ - (void) test_start_offline
6363 [Leanplum_Reachability online: NO ];
6464 [LeanplumHelper setup_development_test ];
6565
66- [OHHTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
66+ [HTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
6767 return [request.URL.host isEqualToString: API_HOST];
68- } withStubResponse: ^OHHTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
68+ } withStubResponse: ^HTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
6969 NSString * response_file = OHPathForFile (@" simple_start_response.json" , self.class );
70- return [OHHTTPStubsResponse responseWithFileAtPath: response_file statusCode: 200
70+ return [HTTPStubsResponse responseWithFileAtPath: response_file statusCode: 200
7171 headers: @{@" Content-Type" :@" application/json" }];
7272 }];
7373
@@ -86,12 +86,12 @@ - (void) test_start_offline
8686
8787- (void ) test_start_malformed_response
8888{
89- [OHHTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
89+ [HTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
9090 return [request.URL.host isEqualToString: API_HOST];
91- } withStubResponse: ^OHHTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
91+ } withStubResponse: ^HTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
9292 NSString * response_file = OHPathForFile (@" malformed_simple_start_response.json" ,
9393 self.class );
94- return [OHHTTPStubsResponse responseWithFileAtPath: response_file statusCode: 200
94+ return [HTTPStubsResponse responseWithFileAtPath: response_file statusCode: 200
9595 headers: @{@" Content-Type" :@" application/json" }];
9696 }];
9797
@@ -100,11 +100,11 @@ - (void) test_start_malformed_response
100100
101101- (void ) test_start_http_error_400
102102{
103- [OHHTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
103+ [HTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
104104 return [request.URL.host isEqualToString: API_HOST];
105- } withStubResponse: ^OHHTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
105+ } withStubResponse: ^HTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
106106 NSString *response_file = OHPathForFile (@" simple_start_response.json" , self.class );
107- return [OHHTTPStubsResponse responseWithFileAtPath: response_file statusCode: 400
107+ return [HTTPStubsResponse responseWithFileAtPath: response_file statusCode: 400
108108 headers: @{@" Content-Type" :@" application/json" }];
109109 }];
110110
@@ -113,11 +113,11 @@ - (void) test_start_http_error_400
113113
114114- (void ) test_start_http_error_401
115115{
116- [OHHTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
116+ [HTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
117117 return [request.URL.host isEqualToString: API_HOST];
118- } withStubResponse: ^OHHTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
118+ } withStubResponse: ^HTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
119119 NSString *response_file = OHPathForFile (@" simple_start_response.json" , self.class );
120- return [OHHTTPStubsResponse responseWithFileAtPath: response_file statusCode: 401
120+ return [HTTPStubsResponse responseWithFileAtPath: response_file statusCode: 401
121121 headers: @{@" Content-Type" :@" application/json" }];
122122 }];
123123
@@ -126,11 +126,11 @@ - (void) test_start_http_error_401
126126
127127- (void ) test_start_http_error_404
128128{
129- [OHHTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
129+ [HTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
130130 return [request.URL.host isEqualToString: API_HOST];
131- } withStubResponse: ^OHHTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
131+ } withStubResponse: ^HTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
132132 NSString *response_file = OHPathForFile (@" simple_start_response.json" , self.class );
133- return [OHHTTPStubsResponse responseWithFileAtPath: response_file statusCode: 404
133+ return [HTTPStubsResponse responseWithFileAtPath: response_file statusCode: 404
134134 headers: @{@" Content-Type" :@" application/json" }];
135135 }];
136136
@@ -140,12 +140,12 @@ - (void) test_start_http_error_404
140140- (void ) test_failed_track
141141{
142142 // This stub have to be removed when start command is successfully executed.
143- id <OHHTTPStubsDescriptor > startStub = [OHHTTPStubs stubRequestsPassingTest:
143+ id <HTTPStubsDescriptor > startStub = [HTTPStubs stubRequestsPassingTest:
144144 ^BOOL (NSURLRequest * _Nonnull request) {
145145 return [request.URL.host isEqualToString: API_HOST];
146- } withStubResponse: ^OHHTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
146+ } withStubResponse: ^HTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
147147 NSString *response_file = OHPathForFile (@" simple_start_response.json" , self.class );
148- return [OHHTTPStubsResponse responseWithFileAtPath: response_file statusCode: 200
148+ return [HTTPStubsResponse responseWithFileAtPath: response_file statusCode: 200
149149 headers: @{@" Content-Type" :@" application/json" }];
150150 }];
151151
@@ -154,15 +154,15 @@ - (void) test_failed_track
154154 }
155155
156156 // Remove stub after start is successful.
157- [OHHTTPStubs removeStub: startStub];
157+ [HTTPStubs removeStub: startStub];
158158
159159 // Create a stub for track event response.
160- [OHHTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
160+ [HTTPStubs stubRequestsPassingTest: ^BOOL (NSURLRequest * _Nonnull request) {
161161 return [request.URL.host isEqualToString: API_HOST];
162- } withStubResponse: ^OHHTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
162+ } withStubResponse: ^HTTPStubsResponse * _Nonnull (NSURLRequest * _Nonnull request) {
163163 NSString *response_file = OHPathForFile (@" malformed_track_event_response.json" ,
164164 self.class );
165- return [OHHTTPStubsResponse responseWithFileAtPath: response_file statusCode: 404
165+ return [HTTPStubsResponse responseWithFileAtPath: response_file statusCode: 404
166166 headers: @{@" Content-Type" :@" application/json" }];
167167 }];
168168
0 commit comments