package wsc

import (
	"testing"

	"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"

	"git.rosy.net.cn/baseapi/utils"
	"git.rosy.net.cn/jx-callback/business/jxutils/tasks"
	"git.rosy.net.cn/jx-callback/globals"
	"git.rosy.net.cn/jx-callback/globals/testinit"
)

func init() {
	testinit.Init()

	if err := tasks.RefreshWeimobToken(); err != nil {
		globals.SugarLogger.Errorf("RefreshWeimobToken failed with error:%s", err)
		return
	}
}

func TestGetVendorCategories(t *testing.T) {
	vendorCatList, err := new(PurchaseHandler).GetVendorCategories(jxcontext.AdminCtx)
	if err != nil {
		t.Fatal(err.Error())
	}
	globals.SugarLogger.Debug(utils.Format4Output(vendorCatList, false))
}
