@@ -107,7 +107,7 @@ func TestCreateAppProtectPolicyEx(t *testing.T) {
107107expectedPolicyEx : & PolicyEx {
108108SignatureReqs : nil ,
109109IsValid : false ,
110- ErrorMsg : "Invalid timestamp" ,
110+ ErrorMsg : "invalid timestamp" ,
111111},
112112wantErr : true ,
113113msg : "policy with invalid min timestamp" ,
@@ -131,7 +131,7 @@ func TestCreateAppProtectPolicyEx(t *testing.T) {
131131expectedPolicyEx : & PolicyEx {
132132SignatureReqs : nil ,
133133IsValid : false ,
134- ErrorMsg : "Invalid timestamp" ,
134+ ErrorMsg : "invalid timestamp" ,
135135},
136136wantErr : true ,
137137msg : "policy with invalid max timestamp" ,
@@ -145,7 +145,7 @@ func TestCreateAppProtectPolicyEx(t *testing.T) {
145145expectedPolicyEx : & PolicyEx {
146146SignatureReqs : nil ,
147147IsValid : false ,
148- ErrorMsg : "Validation Failed " ,
148+ ErrorMsg : "validation failed " ,
149149},
150150wantErr : true ,
151151msg : "policy empty spec" ,
@@ -563,7 +563,7 @@ func TestAddOrUpdatePolicy(t *testing.T) {
563563Resource : & PolicyEx {
564564Obj : invalidTestPolicy ,
565565IsValid : false ,
566- ErrorMsg : "Validation Failed " ,
566+ ErrorMsg : "validation failed " ,
567567},
568568Op : Delete ,
569569},
@@ -584,7 +584,7 @@ func TestAddOrUpdatePolicy(t *testing.T) {
584584Resource : & PolicyEx {
585585Obj : testPolicyUnsatisfied ,
586586IsValid : false ,
587- ErrorMsg : "Policy has unsatisfied signature requirements" ,
587+ ErrorMsg : "policy has unsatisfied signature requirements" ,
588588SignatureReqs : []SignatureReq {
589589{
590590Tag : "test" ,
@@ -601,7 +601,7 @@ func TestAddOrUpdatePolicy(t *testing.T) {
601601{
602602Object : testPolicyUnsatisfied ,
603603Reason : "Rejected" ,
604- Message : "Policy has unsatisfied signature requirements" ,
604+ Message : "policy has unsatisfied signature requirements" ,
605605},
606606},
607607msg : "Missing sig reqs" ,
@@ -671,7 +671,7 @@ func TestAddOrUpdateLogConf(t *testing.T) {
671671Resource : & LogConfEx {
672672Obj : invalidLogConf ,
673673IsValid : false ,
674- ErrorMsg : "Validation Failed " ,
674+ ErrorMsg : "validation failed " ,
675675},
676676Op : Delete ,
677677},
@@ -802,7 +802,7 @@ func TestAddOrUpdateUserSig(t *testing.T) {
802802appProtectConfiguration .Policies ["testing/testpolicy" ] = & PolicyEx {
803803Obj : & unstructured.Unstructured {Object : map [string ]interface {}{}},
804804IsValid : false ,
805- ErrorMsg : "Policy has unsatisfied signature requirements" ,
805+ ErrorMsg : "policy has unsatisfied signature requirements" ,
806806SignatureReqs : []SignatureReq {
807807{
808808Tag : "test3" ,
@@ -839,7 +839,7 @@ func TestAddOrUpdateUserSig(t *testing.T) {
839839{
840840Object : invalidTestUserSig2 ,
841841Reason : "Rejected" ,
842- Message : "Validation Failed " ,
842+ Message : "validation failed " ,
843843},
844844},
845845msg : "validation failed" ,
@@ -854,7 +854,7 @@ func TestAddOrUpdateUserSig(t *testing.T) {
854854expectedProblems : []Problem {
855855{
856856Object : testUserSigDupTag ,
857- Message : "Duplicate tag set" ,
857+ Message : "duplicate tag set" ,
858858Reason : "Rejected" ,
859859},
860860},
@@ -870,7 +870,7 @@ func TestAddOrUpdateUserSig(t *testing.T) {
870870expectedProblems : []Problem {
871871{
872872Object : testUserSig1Invalid ,
873- Message : "Validation Failed " ,
873+ Message : "validation failed " ,
874874Reason : "Rejected" ,
875875},
876876},
@@ -1061,7 +1061,7 @@ func TestDeleteUserSig(t *testing.T) {
10611061expectedProblems : []Problem {
10621062{
10631063Reason : "Rejected" ,
1064- Message : "Policy has unsatisfied signature requirements" ,
1064+ Message : "policy has unsatisfied signature requirements" ,
10651065Object : & unstructured.Unstructured {
10661066Object : map [string ]interface {}{},
10671067},
@@ -1107,14 +1107,14 @@ func TestGetAppProtectResource(t *testing.T) {
11071107kind : "APPolicy" ,
11081108key : "testing/test2" ,
11091109wantErr : true ,
1110- errMsg : "Validation Failed " ,
1110+ errMsg : "validation failed " ,
11111111msg : "Policy, Negative, invalid object" ,
11121112},
11131113{
11141114kind : "APPolicy" ,
11151115key : "testing/test3" ,
11161116wantErr : true ,
1117- errMsg : "App Protect Policy testing/test3 not found" ,
1117+ errMsg : "app protect Policy testing/test3 not found" ,
11181118msg : "Policy, Negative, Object Does not exist" ,
11191119},
11201120{
@@ -1127,14 +1127,14 @@ func TestGetAppProtectResource(t *testing.T) {
11271127kind : "APLogConf" ,
11281128key : "testing/test2" ,
11291129wantErr : true ,
1130- errMsg : "Validation Failed " ,
1130+ errMsg : "validation failed " ,
11311131msg : "LogConf, Negative, invalid object" ,
11321132},
11331133{
11341134kind : "APLogConf" ,
11351135key : "testing/test3" ,
11361136wantErr : true ,
1137- errMsg : "App Protect LogConf testing/test3 not found" ,
1137+ errMsg : "app protect LogConf testing/test3 not found" ,
11381138msg : "LogConf, Negative, Object Does not exist" ,
11391139},
11401140{
@@ -1147,31 +1147,31 @@ func TestGetAppProtectResource(t *testing.T) {
11471147kind : "APUserSig" ,
11481148key : "testing/test2" ,
11491149wantErr : true ,
1150- errMsg : "Validation Failed " ,
1150+ errMsg : "validation failed " ,
11511151msg : "UserSig, Negative, invalid object" ,
11521152},
11531153{
11541154kind : "APUserSig" ,
11551155key : "testing/test3" ,
11561156wantErr : true ,
1157- errMsg : "App Protect UserSig testing/test3 not found" ,
1157+ errMsg : "app protect UserSig testing/test3 not found" ,
11581158msg : "UserSig, Negative, Object Does not exist" ,
11591159},
11601160{
11611161kind : "Notreal" ,
11621162key : "testing/test3" ,
11631163wantErr : true ,
1164- errMsg : "Unknown App Protect resource kind Notreal" ,
1164+ errMsg : "unknown app protect resource kind Notreal" ,
11651165msg : "Invalid kind, Negative" ,
11661166},
11671167}
11681168appProtectConfiguration := newConfigurationImpl ()
11691169appProtectConfiguration .Policies ["testing/test1" ] = & PolicyEx {IsValid : true , Obj : & unstructured.Unstructured {}}
1170- appProtectConfiguration .Policies ["testing/test2" ] = & PolicyEx {IsValid : false , Obj : & unstructured.Unstructured {}, ErrorMsg : "Validation Failed " }
1170+ appProtectConfiguration .Policies ["testing/test2" ] = & PolicyEx {IsValid : false , Obj : & unstructured.Unstructured {}, ErrorMsg : "validation failed " }
11711171appProtectConfiguration .LogConfs ["testing/test1" ] = & LogConfEx {IsValid : true , Obj : & unstructured.Unstructured {}}
1172- appProtectConfiguration .LogConfs ["testing/test2" ] = & LogConfEx {IsValid : false , Obj : & unstructured.Unstructured {}, ErrorMsg : "Validation Failed " }
1172+ appProtectConfiguration .LogConfs ["testing/test2" ] = & LogConfEx {IsValid : false , Obj : & unstructured.Unstructured {}, ErrorMsg : "validation failed " }
11731173appProtectConfiguration .UserSigs ["testing/test1" ] = & UserSigEx {IsValid : true , Obj : & unstructured.Unstructured {}}
1174- appProtectConfiguration .UserSigs ["testing/test2" ] = & UserSigEx {IsValid : false , Obj : & unstructured.Unstructured {}, ErrorMsg : "Validation Failed " }
1174+ appProtectConfiguration .UserSigs ["testing/test2" ] = & UserSigEx {IsValid : false , Obj : & unstructured.Unstructured {}, ErrorMsg : "validation failed " }
11751175
11761176for _ , test := range tests {
11771177_ , err := appProtectConfiguration .GetAppResource (test .kind , test .key )
0 commit comments