任务执行1-19
This commit is contained in:
24
internal/models/blueprint_fields_test.go
Normal file
24
internal/models/blueprint_fields_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTrapDictionaryEntryHasBlueprintFields(t *testing.T) {
|
||||
typ := reflect.TypeOf(TrapDictionaryEntry{})
|
||||
for _, name := range []string{"Vendor", "OID", "Name", "SeverityMappingJSON", "ParseExpression"} {
|
||||
if _, ok := typ.FieldByName(name); !ok {
|
||||
t.Fatalf("TrapDictionaryEntry missing blueprint field %s", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSyslogRuleHasBlueprintFields(t *testing.T) {
|
||||
typ := reflect.TypeOf(SyslogRule{})
|
||||
for _, name := range []string{"SourceMatch", "MessageRegex", "SeverityMappingJSON", "ResourceUIDExtractRegex"} {
|
||||
if _, ok := typ.FieldByName(name); !ok {
|
||||
t.Fatalf("SyslogRule missing blueprint field %s", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user