- TestDecrypt
This commit is contained in:
@@ -1,14 +1,29 @@
|
||||
package dingdingapi
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
func TestEncrypt(t *testing.T) {
|
||||
"git.rosy.net.cn/baseapi"
|
||||
)
|
||||
|
||||
func TestCrypt(t *testing.T) {
|
||||
api.RegisterCallback(nil, "token", "M3Z1b1FIXjlAWW84bEVxNENHSlZOUFJEbkAlRUZQXnE", "")
|
||||
encryptedMsg, err := api.Encrypt("hello")
|
||||
decryptedMsg, err := api.Decrypt(encryptedMsg)
|
||||
t.Log(encryptedMsg, decryptedMsg, err)
|
||||
}
|
||||
|
||||
func TestDecrypt(t *testing.T) {
|
||||
api.RegisterCallback(nil, "j9JMGyaZs&vxqt&S", "VFFjTnZrZDJZZmZHJksxeTlxcnp5aG42WmRCbXl3REE", "")
|
||||
encryptedMsg := "UsgVSPqyJg1aLBmVSbAP19AcIgK/O2UgOfo7lOuwRbSfPDP8XnDUuE+os+nnxsbaMTJ4DSu/twE5aNrZk7RDE9vZYiT/gXqXNvj7y45R32xfOLecVNTvy13wF4vDzuUB"
|
||||
decryptedMsg, err := api.Decrypt(encryptedMsg)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("decryptedMsg:%s\n", decryptedMsg)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPackCallbackResult(t *testing.T) {
|
||||
api.RegisterCallback(nil, "token", "M3Z1b1FIXjlAWW84bEVxNENHSlZOUFJEbkAlRUZQXnE", "")
|
||||
success := api.PackCallbackResult("success")
|
||||
|
||||
Reference in New Issue
Block a user