package test

import (
	"slices"
	"testing"

	"github.com/pingcap/dbaas/billing2/utils/pp"

	"github.com/pingcap/dbaas/billing2/config"

	"github.com/pingcap/dbaas/billing2/handler/cloudmarketplacehandler/cloudimpl"
)

func TestGetToken(t *testing.T) {
	t.Skip()
	config.Get().SetDefault(config.AZUREMarketplaceTenantID, "6c865c34-8ff8-4792-bbca-8c9d15efb29d")
	config.Get().SetDefault(config.AZUREMarketplaceClientID, "9d9f6cfb-ad61-43a0-9301-5764117c06c7")

	handler := &cloudimpl.AzureMarketplaceImpl{}
	handler.GetToken()
	//handler.GetSubscription("e245f536-5315-4a80-d2c0-261a6148917d")
	handler.GetSubscriptionList()
	newTenantMap, _ := handler.GetSubscriptionListByStatus(map[string]bool{"Subscribed": true})
	pp.Print(newTenantMap)
	//quantity := int64(0)
	config.Get().SetDefault(config.AzureOfferList, []string{"tidb_cloud_debug-preview", "tidb_cloud_debug"})
	if slices.Contains(config.Get().GetStringSlice(config.AzureOfferList), "tidb_cloud_debug") {
		pp.Print("sssss")
	}

	//handler.ActivateSubscription("08cef2d7-a09e-4e56-cacb-09e33d89aff8")

	//handler.CancelSubscription("0fd4a68b-bc28-4fbc-da68-d172e7614bef")

}
