MCPcopy
hub / github.com/sideshow/apns2 / TestExpirationHeader

Function TestExpirationHeader

client_test.go:248–265  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

246}
247
248func 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
267func TestPushTypeAlertHeader(t *testing.T) {
268 n := mockNotification()

Callers

nothing calls this directly

Calls 4

mockNotificationFunction · 0.85
mockClientFunction · 0.85
GetMethod · 0.80
PushMethod · 0.80

Tested by

no test coverage detected