Skip to content

Commit

Permalink
refactor jwt parser code and add uts for setProviderID
Browse files Browse the repository at this point in the history
  • Loading branch information
arshadd-b committed Feb 3, 2025
1 parent 58c99ac commit b599c52
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cloud/scope/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ func TestSetVPCProviderID(t *testing.T) {
err := scope.SetProviderID(core.StringPtr(providerID))
g.Expect(err).To(BeNil())
})

t.Run("Set Provider ID returns error", func(t *testing.T) {
g := NewWithT(t)
scope := setupMachineScope(clusterName, machineName, mock.NewMockVpc(gomock.NewController(t)))
options.ProviderIDFormat = string("v2")
utils.GetAccountIDFunc = func() (string, error) {
return "", errors.New("error getting accountID") // Return dummy error
}
err := scope.SetProviderID(core.StringPtr(providerID))
g.Expect(err).NotTo(BeNil())
})
}

func TestCreateMachine(t *testing.T) {
Expand Down

0 comments on commit b599c52

Please sign in to comment.