package api import ( "testing" auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-public/audit-go.git/gen/go/audit/v1" "github.com/stretchr/testify/assert" ) 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) }