Skip to content

Commit

Permalink
remove all builder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenvervaeke committed Nov 20, 2024
1 parent 1fe7105 commit 06e6188
Show file tree
Hide file tree
Showing 384 changed files with 0 additions and 6,415 deletions.
32 changes: 0 additions & 32 deletions internal/cli/accesslists/access_lists_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions internal/cli/accesslists/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
atlasv2 "go.mongodb.org/atlas-sdk/v20241113001/admin"
)

Expand Down Expand Up @@ -50,15 +48,6 @@ func TestWhitelistCreate_Run(t *testing.T) {
}
}

func TestCreateBuilder(t *testing.T) {
test.CmdValidator(
t,
CreateBuilder(),
0,
[]string{flag.ProjectID, flag.Output, flag.TypeFlag, flag.Comment, flag.DeleteAfter},
)
}

func TestValidateCurrentIPFlag(t *testing.T) {
ctrl := gomock.NewController(t)
mockStore := mocks.NewMockProjectIPAccessListCreator(ctrl)
Expand Down
11 changes: 0 additions & 11 deletions internal/cli/accesslists/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
)

func TestWhitelistDelete_Run(t *testing.T) {
Expand All @@ -48,12 +46,3 @@ func TestWhitelistDelete_Run(t *testing.T) {
t.Fatalf("Run() unexpected error: %v", err)
}
}

func TestDeleteBuilder(t *testing.T) {
test.CmdValidator(
t,
DeleteBuilder(),
0,
[]string{flag.ProjectID, flag.Force},
)
}
10 changes: 0 additions & 10 deletions internal/cli/accesslists/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/pointer"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
Expand Down Expand Up @@ -65,12 +64,3 @@ func TestWhitelistDescribe_Run(t *testing.T) {
t.Log(buf.String())
test.VerifyOutputTemplate(t, describeTemplate, expected)
}

func TestDescribeBuilder(t *testing.T) {
test.CmdValidator(
t,
DescribeBuilder(),
0,
[]string{flag.ProjectID, flag.Output},
)
}
10 changes: 0 additions & 10 deletions internal/cli/accesslists/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/pointer"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
Expand Down Expand Up @@ -76,12 +75,3 @@ func TestWhitelistList_Run(t *testing.T) {
t.Log(buf.String())
test.VerifyOutputTemplate(t, listTemplate, expected)
}

func TestListBuilder(t *testing.T) {
test.CmdValidator(
t,
ListBuilder(),
0,
[]string{flag.ProjectID, flag.Output, flag.Page, flag.Limit, flag.OmitCount},
)
}
32 changes: 0 additions & 32 deletions internal/cli/accesslogs/access_logs_test.go

This file was deleted.

10 changes: 0 additions & 10 deletions internal/cli/accesslogs/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/pointer"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
Expand Down Expand Up @@ -98,12 +97,3 @@ func TestAccessLogListHostname_Run(t *testing.T) {
}
test.VerifyOutputTemplate(t, listTemplate, expected)
}

func TestDescribeBuilder(t *testing.T) {
test.CmdValidator(
t,
ListBuilder(),
0,
[]string{flag.ProjectID, flag.Output, flag.Start, flag.End, flag.IP, flag.AuthResult, flag.NLog},
)
}
17 changes: 0 additions & 17 deletions internal/cli/alerts/acknowledge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,11 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
"github.com/stretchr/testify/require"
atlasv2 "go.mongodb.org/atlas-sdk/v20241113001/admin"
)

func TestAcknowledgeBuilder(t *testing.T) {
test.CmdValidator(
t,
AcknowledgeBuilder(),
0,
[]string{
flag.Forever,
flag.Until,
flag.Comment,
flag.ProjectID,
flag.Output,
},
)
}

func TestAcknowledgeOpts_Run(t *testing.T) {
ctrl := gomock.NewController(t)
mockStore := mocks.NewMockAlertAcknowledger(ctrl)
Expand Down
32 changes: 0 additions & 32 deletions internal/cli/alerts/alerts_test.go

This file was deleted.

13 changes: 0 additions & 13 deletions internal/cli/alerts/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/pointer"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
Expand All @@ -32,18 +31,6 @@ import (
atlasv2 "go.mongodb.org/atlas-sdk/v20241113001/admin"
)

func TestDescribeBuilder(t *testing.T) {
test.CmdValidator(
t,
DescribeBuilder(),
0,
[]string{
flag.ProjectID,
flag.Output,
},
)
}

func TestDescribeOpts_Run(t *testing.T) {
ctrl := gomock.NewController(t)
mockStore := mocks.NewMockAlertDescriber(ctrl)
Expand Down
10 changes: 0 additions & 10 deletions internal/cli/alerts/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/pointer"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
Expand Down Expand Up @@ -76,12 +75,3 @@ func TestList_Run(t *testing.T) {
t.Log(buf.String())
test.VerifyOutputTemplate(t, listTemplate, expected)
}

func TestListBuilder(t *testing.T) {
test.CmdValidator(
t,
ListBuilder(),
0,
[]string{flag.ProjectID, flag.Output, flag.Page, flag.Limit, flag.OmitCount, flag.Status},
)
}
17 changes: 0 additions & 17 deletions internal/cli/alerts/settings/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
atlasv2 "go.mongodb.org/atlas-sdk/v20241113001/admin"
)

Expand Down Expand Up @@ -63,18 +61,3 @@ func TestCreate_Run(t *testing.T) {
t.Fatalf("Run() unexpected error: %v", err)
}
}

func TestAcknowledgeBuilder(t *testing.T) {
test.CmdValidator(
t,
CreateBuilder(),
0,
[]string{
flag.Event,
flag.Enabled,
flag.MatcherFieldName,
flag.MatcherOperator,
flag.Output,
},
)
}
13 changes: 0 additions & 13 deletions internal/cli/alerts/settings/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,12 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
"github.com/stretchr/testify/require"
atlasv2 "go.mongodb.org/atlas-sdk/v20241113001/admin"
)

func Test_describeBuilder(t *testing.T) {
test.CmdValidator(
t,
describeBuilder(),
0,
[]string{
flag.ProjectID,
flag.Output,
},
)
}

func TestDescribeTemplate(t *testing.T) {
test.VerifyOutputTemplate(t, settingsTemplate, &atlasv2.GroupAlertsConfig{})
}
Expand Down
14 changes: 0 additions & 14 deletions internal/cli/alerts/settings/disable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,11 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
"github.com/stretchr/testify/require"
atlasv2 "go.mongodb.org/atlas-sdk/v20241113001/admin"
)

func TestDisableBuilder(t *testing.T) {
test.CmdValidator(
t,
EnableBuilder(),
0,
[]string{
flag.ProjectID,
flag.Output,
},
)
}

func TestDisableOpts_Run(t *testing.T) {
ctrl := gomock.NewController(t)
mockStore := mocks.NewMockAlertConfigurationDisabler(ctrl)
Expand Down
14 changes: 0 additions & 14 deletions internal/cli/alerts/settings/enable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,11 @@ import (

"github.com/golang/mock/gomock"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/mocks"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/test"
"github.com/stretchr/testify/require"
atlasv2 "go.mongodb.org/atlas-sdk/v20241113001/admin"
)

func TestEnableBuilder(t *testing.T) {
test.CmdValidator(
t,
EnableBuilder(),
0,
[]string{
flag.ProjectID,
flag.Output,
},
)
}

func TestEnableOpts_Run(t *testing.T) {
ctrl := gomock.NewController(t)
mockStore := mocks.NewMockAlertConfigurationEnabler(ctrl)
Expand Down
Loading

0 comments on commit 06e6188

Please sign in to comment.