From 19e2047d0bd04a78f089d6132818658e4649450f Mon Sep 17 00:00:00 2001 From: George J Padayatti Date: Fri, 15 Dec 2023 08:50:43 +0530 Subject: [PATCH] Upd: In test mode create default policy with id 1 Signed-off-by: George J Padayatti --- internal/tenant/single.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/tenant/single.go b/internal/tenant/single.go index c053f5a..935884a 100644 --- a/internal/tenant/single.go +++ b/internal/tenant/single.go @@ -147,7 +147,12 @@ func deleteAllPolicies() { func createDefaultPolicy(config *config.Configuration, org org.Organization, orgAdminId string) (policy.Policy, error) { var newPolicy policy.Policy - newPolicy.Id = primitive.NewObjectID().Hex() + if config.TestMode { + newPolicy.Id = "1" + } else { + newPolicy.Id = primitive.NewObjectID().Hex() + } + newPolicy.Name = config.Policy.Name newPolicy.Url = org.PolicyURL newPolicy.Jurisdiction = org.Location