Skip to content

Commit

Permalink
fixed acl tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdhulipala committed Feb 3, 2024
1 parent 85a3a41 commit cd783e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion rest_acltemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func (c RestClient) ReplaceACLTemplate(uuid string, template ACLTemplate) error
Description: template.Description,
MetroCode: template.MetroCode,
InboundRules: template.InboundRules,
ProjectID: template.ProjectID,
}
reqBody := mapACLTemplateDomainToAPI(updateTemplate)
req := c.R().SetBody(&reqBody)
Expand Down
8 changes: 7 additions & 1 deletion rest_acltemplate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestGetACLTemplate(t *testing.T) {
func TestReplaceACLTemplate(t *testing.T) {
//given
templateID := "db66bf49-b2d8-4e64-8719-d46406b54039"
template := testACLTemplate
template := updateACLRequestPayload()
reqBody := api.ACLTemplate{}
testHc := &http.Client{}
httpmock.ActivateNonDefault(testHc)
Expand Down Expand Up @@ -194,3 +194,9 @@ func verifyACLTemplateDeviceDetails(t *testing.T, template ACLTemplate, apiTempl
assert.Equal(t, template.DeviceDetails[i].ACLStatus, apiTemplate.DeviceDetails[i].ACLStatus, "ACL Status matches")
}
}

func updateACLRequestPayload() ACLTemplate {
updateRequestPayload := testACLTemplate
updateRequestPayload.ProjectID = nil
return updateRequestPayload
}

0 comments on commit cd783e0

Please sign in to comment.