diff options
Diffstat (limited to 'go/internal/command/command_test.go')
-rw-r--r-- | go/internal/command/command_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/go/internal/command/command_test.go b/go/internal/command/command_test.go index b651c78..e7e37d8 100644 --- a/go/internal/command/command_test.go +++ b/go/internal/command/command_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/authorizedkeys" + "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/authorizedprincipals" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/discover" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/fallback" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/lfsauthenticate" @@ -136,6 +137,16 @@ func TestNew(t *testing.T) { expectedType: &authorizedkeys.Command{}, }, { + desc: "it returns a AuthorizedPrincipals command if the feature is enabled", + executable: &executable.Executable{Name: executable.AuthorizedPrincipalsCheck}, + config: &config.Config{ + Migration: config.MigrationConfig{Enabled: true, Features: []string{"gitlab-shell-authorized-principals-check"}}, + }, + environment: map[string]string{}, + arguments: []string{"key", "principal"}, + expectedType: &authorizedprincipals.Command{}, + }, + { desc: "it returns a Fallback command if the feature is unimplemented", executable: &executable.Executable{Name: executable.GitlabShell}, config: &config.Config{ |