@@ -56,7 +56,7 @@ - (void)testResponseCode200 {
56
56
57
57
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onSuccess is called" ];
58
58
59
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
59
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
60
60
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: ^(NSDictionary * _Nonnull data) {
61
61
[expectation fulfill ];
62
62
XCTAssert ([data isEqualToDictionary: responseData]);
@@ -69,7 +69,7 @@ - (void)testResponseCode200WithNoData {
69
69
70
70
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
71
71
72
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
72
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
73
73
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
74
74
[expectation fulfill ];
75
75
XCTAssertEqualObjects (reason, @" No data received" );
@@ -82,7 +82,7 @@ - (void)testResponseCode200WithInvalidJson {
82
82
83
83
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
84
84
85
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
85
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
86
86
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
87
87
[expectation fulfill ];
88
88
XCTAssert ([reason containsString: @" Could not parse json" ]);
@@ -95,7 +95,7 @@ - (void)testResponseCode400WithoutMessage {
95
95
96
96
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
97
97
98
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
98
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
99
99
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
100
100
[expectation fulfill ];
101
101
XCTAssert ([reason containsString: @" Invalid Request" ]);
@@ -108,7 +108,7 @@ - (void)testResponseCode400WithMessage {
108
108
109
109
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
110
110
111
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
111
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
112
112
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
113
113
[expectation fulfill ];
114
114
XCTAssertEqualObjects (reason, @" Test error" );
@@ -121,7 +121,7 @@ - (void)testResponseCode401 {
121
121
122
122
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
123
123
124
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
124
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
125
125
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
126
126
[expectation fulfill ];
127
127
XCTAssertEqualObjects (reason, @" Invalid API Key" );
@@ -134,7 +134,7 @@ - (void)testResponseCode500 {
134
134
135
135
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
136
136
137
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
137
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
138
138
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
139
139
[expectation fulfill ];
140
140
XCTAssertEqualObjects (reason, @" Internal Server Error" );
@@ -147,7 +147,7 @@ - (void)testNon200ResponseCode {
147
147
148
148
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
149
149
150
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
150
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
151
151
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
152
152
[expectation fulfill ];
153
153
XCTAssert ([reason containsString: @" Received non-200 response" ]);
@@ -165,7 +165,7 @@ - (void)testNoNetworkResponse {
165
165
166
166
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
167
167
168
- NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
168
+ NSURLRequest *request = [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
169
169
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
170
170
[expectation fulfill ];
171
171
XCTAssert ([reason containsString: @" NSURLErrorDomain" ]);
@@ -183,7 +183,7 @@ - (void)testNetworkTimeoutResponse {
183
183
184
184
XCTestExpectation *expectation = [[XCTestExpectation alloc ] initWithDescription: @" onFailure is called" ];
185
185
186
- NSMutableURLRequest *request = (NSMutableURLRequest *) [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withArgs : @{}];
186
+ NSMutableURLRequest *request = (NSMutableURLRequest *) [[IterableAPIInternal sharedInstance ] createPostRequestForAction: @" " withBody : @{}];
187
187
request.timeoutInterval = 0.01 ;
188
188
[[IterableAPIInternal sharedInstance ] sendRequest: request onSuccess: nil onFailure: ^(NSString * _Nonnull reason, NSData * _Nullable data) {
189
189
[expectation fulfill ];
0 commit comments