Corrected unit tests in azuredevops/internal/service/permissions/utils/namespaces_test.go after making GetActionDefinitions public
@@ -319,7 +319,7 @@ func TestSecurityNamespace_GetActionDefinitions_HandleError(t *testing.T) {
Return(nil, fmt.Errorf(errMsg)).
Times(1)
- defs, err := sn.getActionDefinitions()
+ defs, err := sn.GetActionDefinitions()
assert.Nil(t, defs)
assert.EqualError(t, err, errMsg)
}
@@ -350,12 +350,12 @@ func TestSecurityNamespace_GetActionDefinitions_EnsureExistingValuesUnchanged(t
Return(&securityNamespaceDescriptionProject, nil).
Times(1)
- defs1, err := sn.getActionDefinitions()
+ defs1, err := sn.GetActionDefinitions()
assert.Nil(t, err)
assert.NotNil(t, defs1)
// ensure second call does not call QuerySecurityNamespaces again
- defs2, err := sn.getActionDefinitions()
+ defs2, err := sn.GetActionDefinitions()
assert.Nil(t, err)
assert.NotNil(t, defs2)
@@ -389,7 +389,7 @@ func TestSecurityNamespace_GetActionDefinitions_EmptyResultError(t *testing.T) {
Return(&securityNamespaceDescriptionProjectEmpty, nil).
Times(1)
- defs, err := sn.getActionDefinitions()
+ defs, err := sn.GetActionDefinitions()
assert.NotNil(t, err)
assert.Nil(t, defs)
}
@@ -420,7 +420,7 @@ func TestSecurityNamespace_GetActionDefinitions_ValidMapping(t *testing.T) {
Return(&securityNamespaceDescriptionProject, nil).
Times(1)
- defs, err := sn.getActionDefinitions()
+ defs, err := sn.GetActionDefinitions()
assert.Nil(t, err)
assert.NotNil(t, defs)
assert.Equal(t, len(*securityNamespaceDescriptionProject[0].Actions), len(*defs))
