Fix flaky TestRequestTrialLicense test (#18259)

Этот коммит содержится в:
Claudio Costa
2021-08-25 14:56:41 +02:00
коммит произвёл GitHub
родитель eaa37b52ee
Коммит 4dc54004ec
2 изменённых файлов: 36 добавлений и 6 удалений

Просмотреть файл

@@ -20,12 +20,13 @@ import (
)
const (
requestTrialURL = "https://customers.mattermost.com/api/v1/trials"
LicenseEnv = "MM_LICENSE"
LicenseRenewalURL = "https://customers.mattermost.com/subscribe/renew"
JWTDefaultTokenExpiration = 7 * 24 * time.Hour // 7 days of expiration
)
var RequestTrialURL = "https://customers.mattermost.com/api/v1/trials"
// JWTClaims custom JWT claims with the needed information for the
// renewal process
type JWTClaims struct {
@@ -253,7 +254,7 @@ func (s *Server) GetSanitizedClientLicense() map[string]string {
// RequestTrialLicense request a trial license from the mattermost official license server
func (s *Server) RequestTrialLicense(trialRequest *model.TrialLicenseRequest) *model.AppError {
resp, err := http.Post(requestTrialURL, "application/json", bytes.NewBuffer([]byte(trialRequest.ToJson())))
resp, err := http.Post(RequestTrialURL, "application/json", bytes.NewBuffer([]byte(trialRequest.ToJson())))
if err != nil {
return model.NewAppError("RequestTrialLicense", "api.license.request_trial_license.app_error", nil, err.Error(), http.StatusBadRequest)
}