@@ -10,6 +10,7 @@ import (
1010 "testing"
1111)
1212
13+ //nolint:gosec // testServiceAccountToken is a test token
1314const testServiceAccountToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImR1bW15QGV4YW1wbGUuY29tIiwiZXhwIjo5MDA3MTkyNTQ3NDA5OTF9.sM2yd5GL9kK4h8IKHbr_fA2XmrzEsLOeLTIPrU0VfMg"
1415
1516func TestSTACKITCLIFlow_Init (t * testing.T ) {
@@ -32,9 +33,9 @@ func TestSTACKITCLIFlow_Init(t *testing.T) {
3233 }
3334 },
3435 }, false },
35- {"no token" , args {
36+ {"no- token" , args {
3637 cfg : & STACKITCLIFlowConfig {},
37- confFn : func (t * testing.T ) {},
38+ confFn : func (_ * testing.T ) {},
3839 }, true },
3940 }
4041 for _ , tt := range tests {
@@ -43,8 +44,10 @@ func TestSTACKITCLIFlow_Init(t *testing.T) {
4344
4445 c := & STACKITCLIFlow {}
4546
46- _ , _ = runSTACKITCLICommand (ctx , "stackit config profile delete test-stackit-cli-flow-init -y" )
47- _ , err := runSTACKITCLICommand (ctx , "stackit config profile create test-stackit-cli-flow-init" )
47+ cliProfileName := "test-stackit-cli-flow-init" + tt .name
48+
49+ _ , _ = runSTACKITCLICommand (ctx , fmt .Sprintf ("stackit config profile delete %s -y" , cliProfileName ))
50+ _ , err := runSTACKITCLICommand (ctx , "stackit config profile create " + cliProfileName )
4851 if err != nil {
4952 t .Errorf ("runSTACKITCLICommand() error = %v" , err )
5053 return
@@ -53,7 +56,7 @@ func TestSTACKITCLIFlow_Init(t *testing.T) {
5356 tt .args .confFn (t )
5457
5558 defer func () {
56- _ , _ = runSTACKITCLICommand (ctx , "stackit config profile delete test-stackit-cli-flow-init -y" )
59+ _ , _ = runSTACKITCLICommand (ctx , fmt . Sprintf ( "stackit config profile delete %s -y" , cliProfileName ) )
5760 }()
5861
5962 if err := c .Init (tt .args .cfg ); err != nil {
0 commit comments