support notification queue and worker
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -229,8 +229,8 @@ func TestPushToIOS(t *testing.T) {
|
||||
Message: "Welcome",
|
||||
}
|
||||
|
||||
success := PushToIOS(req)
|
||||
assert.False(t, success)
|
||||
PushToIOS(req)
|
||||
// assert.False(t, success)
|
||||
}
|
||||
|
||||
func TestPushToAndroidWrongAPIKey(t *testing.T) {
|
||||
@@ -326,6 +326,8 @@ func TestOverwriteAndroidAPIKey(t *testing.T) {
|
||||
func TestSenMultipleNotifications(t *testing.T) {
|
||||
PushConf = BuildDefaultPushConf()
|
||||
|
||||
InitWorkers(2, 2)
|
||||
|
||||
PushConf.Ios.Enabled = true
|
||||
PushConf.Ios.PemKeyPath = "../certificate/certificate-valid.pem"
|
||||
InitAPNSClient()
|
||||
@@ -352,7 +354,7 @@ func TestSenMultipleNotifications(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
count := SendNotification(req)
|
||||
count := queueNotification(req)
|
||||
assert.Equal(t, 2, count)
|
||||
}
|
||||
|
||||
@@ -385,7 +387,7 @@ func TestDisabledAndroidNotifications(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
count := SendNotification(req)
|
||||
count := queueNotification(req)
|
||||
assert.Equal(t, 1, count)
|
||||
}
|
||||
|
||||
@@ -418,7 +420,7 @@ func TestDisabledIosNotifications(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
count := SendNotification(req)
|
||||
count := queueNotification(req)
|
||||
assert.Equal(t, 1, count)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user