@@ -17,6 +17,8 @@ import (
1717 "github.com/jetstack/preflight/pkg/internal/cyberark/dataupload"
1818 "github.com/jetstack/preflight/pkg/internal/cyberark/identity"
1919 "github.com/jetstack/preflight/pkg/internal/cyberark/servicediscovery"
20+
21+ _ "k8s.io/klog/v2/ktesting/init"
2022)
2123
2224func TestCyberArkClient_PostDataReadingsWithOptions (t * testing.T ) {
@@ -126,6 +128,11 @@ func TestCyberArkClient_PostDataReadingsWithOptions(t *testing.T) {
126128// An API token is obtained by authenticating with the ARK_USERNAME and ARK_SECRET from the environment.
127129// ARK_SUBDOMAIN should be your tenant subdomain.
128130// ARK_PLATFORM_DOMAIN should be either integration-cyberark.cloud or cyberark.cloud
131+ //
132+ // To enable verbose request logging:
133+ //
134+ // go test ./pkg/internal/cyberark/dataupload/... \
135+ // -v -count 1 -run TestPostDataReadingsWithOptionsWithRealAPI -args -testing.v 6
129136func TestPostDataReadingsWithOptionsWithRealAPI (t * testing.T ) {
130137 platformDomain := os .Getenv ("ARK_PLATFORM_DOMAIN" )
131138 subdomain := os .Getenv ("ARK_SUBDOMAIN" )
@@ -137,7 +144,7 @@ func TestPostDataReadingsWithOptionsWithRealAPI(t *testing.T) {
137144 return
138145 }
139146
140- logger := ktesting .NewLogger (t , ktesting .NewConfig () )
147+ logger := ktesting .NewLogger (t , ktesting .DefaultConfig )
141148 ctx := klog .NewContext (t .Context (), logger )
142149
143150 const (
@@ -165,7 +172,7 @@ func TestPostDataReadingsWithOptionsWithRealAPI(t *testing.T) {
165172 cyberArkClient , err := dataupload .NewCyberArkClient (nil , serviceURL , identityClient .AuthenticateRequest )
166173 require .NoError (t , err )
167174
168- err = cyberArkClient .PostDataReadingsWithOptions (t . Context () , api.DataReadingsPost {}, dataupload.Options {
175+ err = cyberArkClient .PostDataReadingsWithOptions (ctx , api.DataReadingsPost {}, dataupload.Options {
169176 ClusterName : "bb068932-c80d-460d-88df-34bc7f3f3297" ,
170177 })
171178 require .NoError (t , err )
0 commit comments