(t *testing.T)
| 246 | } |
| 247 | |
| 248 | func TestExpirationHeader(t *testing.T) { |
| 249 | n := mockNotification() |
| 250 | n.ApnsID = "84DB694F-464F-49BD-960A-D6DB028335C9" |
| 251 | n.CollapseID = "game1.start.identifier" |
| 252 | n.Topic = "com.testapp" |
| 253 | n.Priority = 10 |
| 254 | n.Expiration = time.Unix(0, 0) |
| 255 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 256 | assert.Equal(t, n.ApnsID, r.Header.Get("apns-id")) |
| 257 | assert.Equal(t, n.CollapseID, r.Header.Get("apns-collapse-id")) |
| 258 | assert.Equal(t, "10", r.Header.Get("apns-priority")) |
| 259 | assert.Equal(t, n.Topic, r.Header.Get("apns-topic")) |
| 260 | assert.Equal(t, "", r.Header.Get("apns-expiration")) |
| 261 | })) |
| 262 | defer server.Close() |
| 263 | _, err := mockClient(server.URL).Push(n) |
| 264 | assert.NoError(t, err) |
| 265 | } |
| 266 | |
| 267 | func TestPushTypeAlertHeader(t *testing.T) { |
| 268 | n := mockNotification() |
nothing calls this directly
no test coverage detected