Skip to content

Commit 182bce6

Browse files
committed
Add batch push tests
1 parent 709052f commit 182bce6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

push_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,35 @@ func TestCiphertext(t *testing.T) {
235235
})
236236
}
237237

238+
func TestBatchPush(t *testing.T) {
239+
Endpoint(t, []APITestCase{
240+
{
241+
Name: "Batch Push",
242+
Method: "POST",
243+
URL: "/" + key,
244+
Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\":[\"" + key + "\",\"" + key + "\",\"" + key + "\"]}",
245+
IsJson: true,
246+
WantStatusCode: 200,
247+
},
248+
{
249+
Name: "Batch Push",
250+
Method: "POST",
251+
URL: "/push",
252+
Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\":[\"" + key + "\",\"" + key + "\",\"" + key + "\"]}",
253+
IsJson: true,
254+
WantStatusCode: 200,
255+
},
256+
{
257+
Name: "Batch Push",
258+
Method: "POST",
259+
URL: "/push",
260+
Body: "{\"title\":\"title\",\"subtitle\":\"subtitle\",\"body\":\"body\",\"device_keys\": \"" + key + "," + key + "," + key + "\"}",
261+
IsJson: true,
262+
WantStatusCode: 200,
263+
},
264+
})
265+
}
266+
238267
type APITestCase struct {
239268
Name string
240269
Method string

0 commit comments

Comments
 (0)