6
6
"testing"
7
7
8
8
"github.com/google/go-cmp/cmp"
9
+ "github.com/google/uuid"
9
10
"github.com/stackitcloud/stackit-cli/internal/cmd/params"
10
11
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
11
12
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
@@ -16,6 +17,7 @@ import (
16
17
type testCtxKey struct {}
17
18
18
19
var testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
20
+ var testProjectId = uuid .NewString ()
19
21
20
22
type postgresFlexClientMocked struct {
21
23
listFlavorsFails bool
@@ -63,10 +65,11 @@ func (c *postgresFlexClientMocked) ListStoragesExecute(_ context.Context, _, _,
63
65
64
66
func fixtureFlagValues (mods ... func (flagValues map [string ]string )) map [string ]string {
65
67
flagValues := map [string ]string {
66
- flavorsFlag : "true" ,
67
- versionsFlag : "true" ,
68
- storagesFlag : "true" ,
69
- flavorIdFlag : "2.4" ,
68
+ globalflags .ProjectIdFlag : testProjectId ,
69
+ flavorsFlag : "true" ,
70
+ versionsFlag : "true" ,
71
+ storagesFlag : "true" ,
72
+ flavorIdFlag : "2.4" ,
70
73
}
71
74
for _ , mod := range mods {
72
75
mod (flagValues )
@@ -76,10 +79,13 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
76
79
77
80
func fixtureInputModelAllFalse (mods ... func (model * inputModel )) * inputModel {
78
81
model := & inputModel {
79
- GlobalFlagModel : & globalflags.GlobalFlagModel {Verbosity : globalflags .VerbosityDefault },
80
- Flavors : false ,
81
- Versions : false ,
82
- Storages : false ,
82
+ GlobalFlagModel : & globalflags.GlobalFlagModel {
83
+ ProjectId : testProjectId ,
84
+ Verbosity : globalflags .VerbosityDefault ,
85
+ },
86
+ Flavors : false ,
87
+ Versions : false ,
88
+ Storages : false ,
83
89
}
84
90
for _ , mod := range mods {
85
91
mod (model )
@@ -89,11 +95,14 @@ func fixtureInputModelAllFalse(mods ...func(model *inputModel)) *inputModel {
89
95
90
96
func fixtureInputModelAllTrue (mods ... func (model * inputModel )) * inputModel {
91
97
model := & inputModel {
92
- GlobalFlagModel : & globalflags.GlobalFlagModel {Verbosity : globalflags .VerbosityDefault },
93
- Flavors : true ,
94
- Versions : true ,
95
- Storages : true ,
96
- FlavorId : utils .Ptr ("2.4" ),
98
+ GlobalFlagModel : & globalflags.GlobalFlagModel {
99
+ ProjectId : testProjectId ,
100
+ Verbosity : globalflags .VerbosityDefault ,
101
+ },
102
+ Flavors : true ,
103
+ Versions : true ,
104
+ Storages : true ,
105
+ FlavorId : utils .Ptr ("2.4" ),
97
106
}
98
107
for _ , mod := range mods {
99
108
mod (model )
0 commit comments