Skip to content

Commit

Permalink
refactor: fixes typo in OnboardInitialUser method
Browse files Browse the repository at this point in the history
Fixes typo introduced by 7b99c28
  • Loading branch information
marcdel committed Mar 20, 2020
1 parent e116eca commit ea8e6d1
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions authorizer/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestOnboardingValidation(t *testing.T) {
svc := newKVSVC(t)
ts := authorizer.NewTaskService(zaptest.NewLogger(t), mockTaskService(3, 2, 1))

r, err := svc.OnboardInitalUser(context.Background(), &influxdb.OnboardingRequest{
r, err := svc.OnboardInitialUser(context.Background(), &influxdb.OnboardingRequest{
User: "Setec Astronomy",
Password: "too many secrets",
Org: "thing",
Expand Down Expand Up @@ -121,7 +121,7 @@ func TestValidations(t *testing.T) {

svc := newKVSVC(t)

r, err := svc.OnboardInitalUser(context.Background(), &influxdb.OnboardingRequest{
r, err := svc.OnboardInitialUser(context.Background(), &influxdb.OnboardingRequest{
User: "Setec Astronomy",
Password: "too many secrets",
Org: "thing",
Expand Down
2 changes: 1 addition & 1 deletion cmd/influx/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func setupF(cmd *cobra.Command, args []string) error {
return fmt.Errorf("failed to retrieve data to setup instance: %v", err)
}

result, err := s.OnboardInitalUser(context.Background(), req)
result, err := s.OnboardInitialUser(context.Background(), req)
if err != nil {
return fmt.Errorf("failed to setup instance: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/launcher/launcher_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (tl *TestLauncher) SetupOrFail(tb testing.TB) {
// OnBoard attempts an on-boarding request.
// The on-boarding status is also reset to allow multiple user/org/buckets to be created.
func (tl *TestLauncher) OnBoard(req *platform.OnboardingRequest) (*platform.OnboardingResults, error) {
res, err := tl.KeyValueService().OnboardInitalUser(context.Background(), req)
res, err := tl.KeyValueService().OnboardInitialUser(context.Background(), req)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/launcher/launcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestLauncher_Setup(t *testing.T) {
defer l.Shutdown(ctx)

svc := &http.SetupService{Addr: l.URL()}
if results, err := svc.OnboardInitalUser(ctx, &platform.OnboardingRequest{
if results, err := svc.OnboardInitialUser(ctx, &platform.OnboardingRequest{
User: "USER",
Password: "PASSWORD",
Org: "ORG",
Expand Down
6 changes: 3 additions & 3 deletions http/onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (h *SetupHandler) handlePostSetup(w http.ResponseWriter, r *http.Request) {
h.HandleHTTPError(ctx, err, w)
return
}
results, err := h.OnboardingService.OnboardInitalUser(ctx, req)
results, err := h.OnboardingService.OnboardInitialUser(ctx, req)
if err != nil {
h.HandleHTTPError(ctx, err, w)
return
Expand Down Expand Up @@ -166,8 +166,8 @@ func (s *SetupService) IsOnboarding(ctx context.Context) (bool, error) {
return ir.Allowed, nil
}

// OnboardInitalUser OnboardingResults.
func (s *SetupService) OnboardInitalUser(ctx context.Context, or *platform.OnboardingRequest) (*platform.OnboardingResults, error) {
// OnboardInitialUser OnboardingResults.
func (s *SetupService) OnboardInitialUser(ctx context.Context, or *platform.OnboardingRequest) (*platform.OnboardingResults, error) {
u, err := NewURL(s.Addr, prefixSetup)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion http/onboarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ func initOnboardingService(f platformtesting.OnboardingFields, t *testing.T) (pl
return client, done
}
func TestOnboardingService(t *testing.T) {
platformtesting.OnboardInitalUser(initOnboardingService, t)
platformtesting.OnboardInitialUser(initOnboardingService, t)
}
4 changes: 2 additions & 2 deletions kv/onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ func (s *Service) setOnboarded(ctx context.Context, tx Tx) error {
return nil
}

// OnboardInitalUser OnboardingResults from onboarding request,
// OnboardInitialUser OnboardingResults from onboarding request,
// update db so this request will be disabled for the second run.
func (s *Service) OnboardInitalUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error) {
func (s *Service) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error) {
isOnboarding, err := s.IsOnboarding(ctx)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion kv/onboarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestBoltOnboardingService(t *testing.T) {
influxdbtesting.OnboardInitalUser(initBoltOnboardingService, t)
influxdbtesting.OnboardInitialUser(initBoltOnboardingService, t)
}

func initBoltOnboardingService(f influxdbtesting.OnboardingFields, t *testing.T) (influxdb.OnboardingService, func()) {
Expand Down
4 changes: 2 additions & 2 deletions mock/onboarding_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (s *OnboardingService) IsOnboarding(ctx context.Context) (bool, error) {
return s.IsOnboardingFn(ctx)
}

// OnboardInitalUser OnboardingResults.
func (s *OnboardingService) OnboardInitalUser(ctx context.Context, req *platform.OnboardingRequest) (*platform.OnboardingResults, error) {
// OnboardInitialUser OnboardingResults.
func (s *OnboardingService) OnboardInitialUser(ctx context.Context, req *platform.OnboardingRequest) (*platform.OnboardingResults, error) {
return s.GenerateFn(ctx, req)
}
4 changes: 2 additions & 2 deletions onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ type OnboardingService interface {

// IsOnboarding determine if onboarding request is allowed.
IsOnboarding(ctx context.Context) (bool, error)
// OnboardInitalUser OnboardingResults.
OnboardInitalUser(ctx context.Context, req *OnboardingRequest) (*OnboardingResults, error)
// OnboardInitialUser OnboardingResults.
OnboardInitialUser(ctx context.Context, req *OnboardingRequest) (*OnboardingResults, error)
}

// OnboardingResults is a group of elements required for first run.
Expand Down
6 changes: 3 additions & 3 deletions testing/onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type OnboardingFields struct {
IsOnboarding bool
}

// OnboardInitalUser testing
func OnboardInitalUser(
// OnboardInitialUser testing
func OnboardInitialUser(
init func(OnboardingFields, *testing.T) (platform.OnboardingService, func()),
t *testing.T,
) {
Expand Down Expand Up @@ -195,7 +195,7 @@ func OnboardInitalUser(
s, done := init(tt.fields, t)
defer done()
ctx := context.Background()
results, err := s.OnboardInitalUser(ctx, tt.args.request)
results, err := s.OnboardInitialUser(ctx, tt.args.request)
if (err != nil) != (tt.wants.errCode != "") {
t.Logf("Error: %v", err)
t.Fatalf("expected error code '%s' got '%v'", tt.wants.errCode, err)
Expand Down

0 comments on commit ea8e6d1

Please sign in to comment.