Skip to content

Commit

Permalink
fixup on test refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Dec 12, 2024
1 parent be6b589 commit 782c6c4
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions pkg/driver/provisioner_server_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ var _ = Describe("ProvisionerServer DriverCreateBucket", Ordered, func() {

var _ = Describe("FetchSecretInformation", Ordered, func() {
var (
parameters map[string]string
secretName string
namespace string
parameters map[string]string
secretName string
namespace string
)

BeforeEach(func() {
Expand Down Expand Up @@ -473,6 +473,17 @@ var _ = Describe("initializeObjectStorageClient", Ordered, func() {
_, _, err = driver.InitializeClient(ctx, clientset, parameters, "IAM")
Expect(status.Code(err)).To(Equal(codes.Internal))
})

It("should return error when FetchSecretInformation fails", func(ctx SpecContext) {
delete(parameters, "objectStorageSecretName")

s3Client, s3Params, err := driver.InitializeClient(ctx, clientset, parameters, "S3")
Expect(s3Client).To(BeNil())
Expect(s3Params).To(BeNil())
Expect(err).To(HaveOccurred())
Expect(status.Code(err)).To(Equal(codes.InvalidArgument))
Expect(err.Error()).To(ContainSubstring("Object storage provider secret name and namespace are required"))
})
})

var _ = Describe("FetchParameters", Ordered, func() {
Expand Down

0 comments on commit 782c6c4

Please sign in to comment.