package api import ( auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/common-audit.git/gen/go/audit/v1" "github.com/stretchr/testify/assert" "testing" ) func Test_ConvertAndSerializeIntoLegacyFormat_NoObjectIdentifier(t *testing.T) { event, _ := NewProjectAuditEvent(nil) routableEvent := auditV1.RoutableAuditEvent{ OperationName: event.ProtoPayload.OperationName, Visibility: auditV1.Visibility_VISIBILITY_PUBLIC, ObjectIdentifier: nil, Data: nil, } _, err := convertAndSerializeIntoLegacyFormat(event, &routableEvent) assert.ErrorIs(t, err, ErrObjectIdentifierNil) }