diff --git a/cli/command/engine/activate_test.go b/cli/command/engine/activate_test.go index a740d18041..9eff3b8cf0 100644 --- a/cli/command/engine/activate_test.go +++ b/cli/command/engine/activate_test.go @@ -92,7 +92,7 @@ func (c mockLicenseClient) GetHubUserByName(ctx context.Context, username string func (c mockLicenseClient) VerifyLicense(ctx context.Context, license model.IssuedLicense) (res *model.CheckResponse, err error) { return nil, fmt.Errorf("not implemented") } -func (c mockLicenseClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { +func (c mockLicenseClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { return "", fmt.Errorf("not implemented") } func (c mockLicenseClient) ListSubscriptions(ctx context.Context, authToken, dockerID string) (response []*model.Subscription, err error) { diff --git a/internal/licenseutils/client_test.go b/internal/licenseutils/client_test.go index 40bb37f2de..b0b202ebb1 100644 --- a/internal/licenseutils/client_test.go +++ b/internal/licenseutils/client_test.go @@ -13,7 +13,7 @@ type ( getHubUserOrgsFunc func(ctx context.Context, authToken string) (orgs []model.Org, err error) getHubUserByNameFunc func(ctx context.Context, username string) (user *model.User, err error) verifyLicenseFunc func(ctx context.Context, license model.IssuedLicense) (res *model.CheckResponse, err error) - generateNewTrialSubscriptionFunc func(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) + generateNewTrialSubscriptionFunc func(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) listSubscriptionsFunc func(ctx context.Context, authToken, dockerID string) (response []*model.Subscription, err error) listSubscriptionsDetailsFunc func(ctx context.Context, authToken, dockerID string) (response []*model.SubscriptionDetail, err error) downloadLicenseFromHubFunc func(ctx context.Context, authToken, subscriptionID string) (license *model.IssuedLicense, err error) @@ -52,9 +52,9 @@ func (c *fakeLicensingClient) VerifyLicense(ctx context.Context, license model.I return nil, nil } -func (c *fakeLicensingClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { +func (c *fakeLicensingClient) GenerateNewTrialSubscription(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { if c.generateNewTrialSubscriptionFunc != nil { - return c.generateNewTrialSubscriptionFunc(ctx, authToken, dockerID, email) + return c.generateNewTrialSubscriptionFunc(ctx, authToken, dockerID) } return "", nil } diff --git a/internal/licenseutils/utils.go b/internal/licenseutils/utils.go index a6809d17ed..d9503dc652 100644 --- a/internal/licenseutils/utils.go +++ b/internal/licenseutils/utils.go @@ -134,7 +134,7 @@ func (u HubUser) GetAvailableLicenses(ctx context.Context) ([]LicenseDisplay, er // GenerateTrialLicense will generate a new trial license for the specified user or org func (u HubUser) GenerateTrialLicense(ctx context.Context, targetID string) (*model.IssuedLicense, error) { - subID, err := u.Client.GenerateNewTrialSubscription(ctx, u.token, targetID, u.User.Email) + subID, err := u.Client.GenerateNewTrialSubscription(ctx, u.token, targetID) if err != nil { return nil, err } diff --git a/internal/licenseutils/utils_test.go b/internal/licenseutils/utils_test.go index 1033640de2..68b67239fe 100644 --- a/internal/licenseutils/utils_test.go +++ b/internal/licenseutils/utils_test.go @@ -147,7 +147,7 @@ func TestGenerateTrialFail(t *testing.T) { ctx := context.Background() user := HubUser{ Client: &fakeLicensingClient{ - generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { + generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { return "", fmt.Errorf("generate trial failure") }, }, @@ -161,7 +161,7 @@ func TestGenerateTrialHappy(t *testing.T) { ctx := context.Background() user := HubUser{ Client: &fakeLicensingClient{ - generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID, email string) (subscriptionID string, err error) { + generateNewTrialSubscriptionFunc: func(ctx context.Context, authToken, dockerID string) (subscriptionID string, err error) { return "subid", nil }, },