mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-08 00:57:24 +00:00
20 lines
626 B
Go
20 lines
626 B
Go
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)
|
|
}
|