- basic mtps api added.
This commit is contained in:
40
platform/mtpsapi/mtpsapi_test.go
Normal file
40
platform/mtpsapi/mtpsapi_test.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package mtpsapi
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var (
|
||||
mtpsapi *MTPSAPI
|
||||
sugarLogger *zap.SugaredLogger
|
||||
)
|
||||
|
||||
func init() {
|
||||
logger, _ := zap.NewDevelopment()
|
||||
sugarLogger = logger.Sugar()
|
||||
mtpsapi = NewMTPSAPI("3c0a05d464c247c19d7ec13accc78605", "b1M}9?:sTbsB[OF2gNORnN(|(iy9rB8(`7]|[wGLnbmt`evfM>E:A90DjHAW:UPE", sugarLogger)
|
||||
}
|
||||
|
||||
func TestTest(t *testing.T) {
|
||||
sugarLogger.Debug(utils.GetCurTimeStr())
|
||||
}
|
||||
|
||||
func TestAccessMTPS(t *testing.T) {
|
||||
mtPeiSongId := "1528955769086020"
|
||||
params := map[string]interface{}{
|
||||
"delivery_id": 378194,
|
||||
"mt_peisong_id": mtPeiSongId,
|
||||
}
|
||||
result, err := mtpsapi.AccessMTPS("order/status/query", params)
|
||||
if err != nil {
|
||||
t.Fatalf("Error when accessing AccessMTPS result:%v, error:%v", result, err)
|
||||
} else {
|
||||
getMtPsId := result.Data["mt_peisong_id"].(string)
|
||||
if getMtPsId != mtPeiSongId {
|
||||
t.Fatalf("mt_peisong_id is not same, %v vs %v", mtPeiSongId, getMtPsId)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user