From cd783e0ae34291c122bb25c756b30eca71153148 Mon Sep 17 00:00:00 2001 From: kpdhulipala Date: Fri, 2 Feb 2024 23:27:46 -0800 Subject: [PATCH] fixed acl tests --- rest_acltemplate.go | 1 - rest_acltemplate_test.go | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rest_acltemplate.go b/rest_acltemplate.go index f06a133..e5808ef 100644 --- a/rest_acltemplate.go +++ b/rest_acltemplate.go @@ -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) diff --git a/rest_acltemplate_test.go b/rest_acltemplate_test.go index bc2720b..0ecb2fd 100644 --- a/rest_acltemplate_test.go +++ b/rest_acltemplate_test.go @@ -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) @@ -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 +}