66 "testing"
77
88 "github.com/google/go-cmp/cmp"
9+ "github.com/google/uuid"
910 "github.com/stackitcloud/stackit-cli/internal/cmd/params"
1011 "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
1112 "github.com/stackitcloud/stackit-cli/internal/pkg/print"
@@ -16,6 +17,7 @@ import (
1617type testCtxKey struct {}
1718
1819var testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
20+ var testProjectId = uuid .NewString ()
1921
2022type postgresFlexClientMocked struct {
2123 listFlavorsFails bool
@@ -63,10 +65,11 @@ func (c *postgresFlexClientMocked) ListStoragesExecute(_ context.Context, _, _,
6365
6466func fixtureFlagValues (mods ... func (flagValues map [string ]string )) map [string ]string {
6567 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" ,
7073 }
7174 for _ , mod := range mods {
7275 mod (flagValues )
@@ -76,10 +79,13 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
7679
7780func fixtureInputModelAllFalse (mods ... func (model * inputModel )) * inputModel {
7881 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 ,
8389 }
8490 for _ , mod := range mods {
8591 mod (model )
@@ -89,11 +95,14 @@ func fixtureInputModelAllFalse(mods ...func(model *inputModel)) *inputModel {
8995
9096func fixtureInputModelAllTrue (mods ... func (model * inputModel )) * inputModel {
9197 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" ),
97106 }
98107 for _ , mod := range mods {
99108 mod (model )
0 commit comments