mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-07 16:47:24 +00:00
21 lines
616 B
Go
21 lines
616 B
Go
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)
|
|
}
|