github.com/arunkumar7540/cli@v6.45.0+incompatible/integration/helpers/client_credentials.go (about) 1 package helpers 2 3 import ( 4 "os" 5 6 . "github.com/onsi/ginkgo" 7 ) 8 9 // SkipIfClientCredentialsNotSet will skip the test when either 10 // CF_INT_CLIENT_ID or CF_INT_CLIENT_SECRET are not set. 11 func SkipIfClientCredentialsNotSet() (string, string) { 12 privateClientID := os.Getenv("CF_INT_CLIENT_ID") 13 privateClientSecret := os.Getenv("CF_INT_CLIENT_SECRET") 14 15 if privateClientID == "" || privateClientSecret == "" { 16 Skip("CF_INT_CLIENT_ID or CF_INT_CLIENT_SECRET is not set") 17 } 18 19 return privateClientID, privateClientSecret 20 } 21 22 // SkipIfCustomClientCredentialsNotSet will skip the test when either 23 // CF_INT_CUSTOM_CLIENT_ID or CF_INT_CUSTOM_CLIENT_SECRET are not set. 24 func SkipIfCustomClientCredentialsNotSet() (string, string) { 25 customClientID := os.Getenv("CF_INT_CUSTOM_CLIENT_ID") 26 customClientSecret := os.Getenv("CF_INT_CUSTOM_CLIENT_SECRET") 27 28 if customClientID == "" || customClientSecret == "" { 29 Skip("CF_INT_CUSTOM_CLIENT_ID or CF_INT_CUSTOM_CLIENT_SECRET is not set") 30 } 31 32 return customClientID, customClientSecret 33 }