mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-08 00:57:24 +00:00
Make test data factory methods private
This commit is contained in:
parent
a990233715
commit
d1b1ae040f
7 changed files with 50 additions and 50 deletions
|
|
@ -72,7 +72,7 @@ func Test_ValidateAndSerializePartially_EventNil(t *testing.T) {
|
|||
func Test_ValidateAndSerializePartially_AuditEventValidationFailed(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
event.LogName = ""
|
||||
|
||||
_, err := validateAndSerializePartially(
|
||||
|
|
@ -84,7 +84,7 @@ func Test_ValidateAndSerializePartially_AuditEventValidationFailed(t *testing.T)
|
|||
func Test_ValidateAndSerializePartially_RoutableEventValidationFailed(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
_, err := validateAndSerializePartially(&validator, event, 3, NewRoutableIdentifier(objectIdentifier))
|
||||
|
||||
assert.EqualError(t, err, "validation error:\n - visibility: value must be one of the defined enum values [enum.defined_only]")
|
||||
|
|
@ -93,7 +93,7 @@ func Test_ValidateAndSerializePartially_RoutableEventValidationFailed(t *testing
|
|||
func Test_ValidateAndSerializePartially_CheckVisibility_Event(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
|
||||
t.Run("Visibility public - object identifier nil", func(t *testing.T) {
|
||||
_, err := validateAndSerializePartially(
|
||||
|
|
@ -143,7 +143,7 @@ func Test_ValidateAndSerializePartially_CheckVisibility_Event(t *testing.T) {
|
|||
func Test_ValidateAndSerializePartially_CheckVisibility_SystemEvent(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
|
||||
t.Run("Visibility public - object identifier nil", func(t *testing.T) {
|
||||
_, err := validateAndSerializePartially(
|
||||
|
|
@ -195,7 +195,7 @@ func Test_ValidateAndSerializePartially_CheckVisibility_SystemEvent(t *testing.T
|
|||
func Test_ValidateAndSerializePartially_UnsupportedIdentifierType(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
objectIdentifier.Type = "invalid"
|
||||
|
||||
_, err := validateAndSerializePartially(
|
||||
|
|
@ -207,7 +207,7 @@ func Test_ValidateAndSerializePartially_UnsupportedIdentifierType(t *testing.T)
|
|||
func Test_ValidateAndSerializePartially_LogNameIdentifierMismatch(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
parts := strings.Split(event.LogName, "/")
|
||||
identifier := parts[1]
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ func Test_ValidateAndSerializePartially_LogNameIdentifierMismatch(t *testing.T)
|
|||
func Test_ValidateAndSerializePartially_ResourceNameIdentifierMismatch(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
parts := strings.Split(event.ProtoPayload.ResourceName, "/")
|
||||
identifier := parts[1]
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ func Test_ValidateAndSerializePartially_ResourceNameIdentifierMismatch(t *testin
|
|||
func Test_ValidateAndSerializePartially_SystemEvent(t *testing.T) {
|
||||
validator := NewValidator(t)
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
|
||||
routableEvent, err := validateAndSerializePartially(
|
||||
&validator, event, auditV1.Visibility_VISIBILITY_PRIVATE, RoutableSystemIdentifier)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
func Test_ConvertAndSerializeIntoLegacyFormat_NoObjectIdentifier(t *testing.T) {
|
||||
event, _ := NewProjectAuditEvent(nil)
|
||||
event, _ := newProjectAuditEvent(nil)
|
||||
routableEvent := auditV1.RoutableAuditEvent{
|
||||
OperationName: event.ProtoPayload.OperationName,
|
||||
Visibility: auditV1.Visibility_VISIBILITY_PUBLIC,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
event.LogName = strings.Replace(event.LogName, string(EventTypeAdminActivity), string(EventTypeDataAccess), 1)
|
||||
|
||||
// Log the event to solace
|
||||
|
|
@ -97,7 +97,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -136,7 +136,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -176,7 +176,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -215,7 +215,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -255,7 +255,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewProjectAuditEvent(nil)
|
||||
event, objectIdentifier := newProjectAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -294,7 +294,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewProjectAuditEvent(nil)
|
||||
event, objectIdentifier := newProjectAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -333,7 +333,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -390,7 +390,7 @@ func TestDynamicLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
escapedQuery := url.QueryEscape("param=value")
|
||||
event.ProtoPayload.RequestMetadata.RequestAttributes.Query = &escapedQuery
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ func TestDynamicLegacyAuditApi_ValidateAndSerialize_ValidationFailed(t *testing.
|
|||
|
||||
auditApi := DynamicLegacyAuditApi{validator: &protobufValidator}
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||
assert.ErrorIs(t, err, expectedError)
|
||||
}
|
||||
|
|
@ -442,7 +442,7 @@ func TestDynamicLegacyAuditApi_Log_ValidationFailed(t *testing.T) {
|
|||
|
||||
auditApi := DynamicLegacyAuditApi{validator: &protobufValidator}
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
err := auditApi.Log(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||
assert.ErrorIs(t, err, expectedError)
|
||||
}
|
||||
|
|
@ -458,7 +458,7 @@ func TestDynamicLegacyAuditApi_ConvertAndSerializeIntoLegacyFormatInvalidObjectI
|
|||
objectIdentifier *auditV1.ObjectIdentifier) {
|
||||
objectIdentifier.Type = "invalid"
|
||||
}
|
||||
event, objectIdentifier := NewProjectAuditEvent(&customization)
|
||||
event, objectIdentifier := newProjectAuditEvent(&customization)
|
||||
|
||||
validator := &ProtobufValidatorMock{}
|
||||
validator.On("Validate", mock.Anything).Return(nil)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
event.LogName = strings.Replace(event.LogName, string(EventTypeAdminActivity), string(EventTypeDataAccess), 1)
|
||||
|
||||
// Log the event to solace
|
||||
|
|
@ -99,7 +99,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -138,7 +138,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -178,7 +178,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -217,7 +217,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -257,7 +257,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewProjectAuditEvent(nil)
|
||||
event, objectIdentifier := newProjectAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -296,7 +296,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewProjectAuditEvent(nil)
|
||||
event, objectIdentifier := newProjectAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -335,7 +335,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -392,7 +392,7 @@ func TestLegacyAuditApi(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
escapedQuery := url.QueryEscape("param=value")
|
||||
event.ProtoPayload.RequestMetadata.RequestAttributes.Query = &escapedQuery
|
||||
|
||||
|
|
@ -546,7 +546,7 @@ func TestLegacyAuditApi_ValidateAndSerialize_ValidationFailed(t *testing.T) {
|
|||
|
||||
auditApi := LegacyAuditApi{validator: &protobufValidator}
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||
assert.ErrorIs(t, err, expectedError)
|
||||
}
|
||||
|
|
@ -560,7 +560,7 @@ func TestLegacyAuditApi_Log_ValidationFailed(t *testing.T) {
|
|||
|
||||
auditApi := LegacyAuditApi{validator: &protobufValidator}
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
err := auditApi.Log(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||
assert.ErrorIs(t, err, expectedError)
|
||||
}
|
||||
|
|
@ -576,7 +576,7 @@ func TestLegacyAuditApi_ConvertAndSerializeIntoLegacyFormatInvalidObjectIdentifi
|
|||
objectIdentifier *auditV1.ObjectIdentifier) {
|
||||
objectIdentifier.Type = "invalid"
|
||||
}
|
||||
event, objectIdentifier := NewProjectAuditEvent(&customization)
|
||||
event, objectIdentifier := newProjectAuditEvent(&customization)
|
||||
|
||||
validator := &ProtobufValidatorMock{}
|
||||
validator.On("Validate", mock.Anything).Return(nil)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ func TestMockAuditApi_Log(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
routableObjectIdentifier := NewRoutableIdentifier(objectIdentifier)
|
||||
|
||||
// Test
|
||||
|
|
@ -26,7 +26,7 @@ func TestMockAuditApi_Log(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("reject data access event", func(t *testing.T) {
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
event.LogName = strings.Replace(event.LogName, string(EventTypeAdminActivity), string(EventTypeDataAccess), 1)
|
||||
routableObjectIdentifier := NewRoutableIdentifier(objectIdentifier)
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "org/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
event.LogName = strings.Replace(event.LogName, string(EventTypeAdminActivity), string(EventTypeDataAccess), 1)
|
||||
|
||||
// Log the event to solace
|
||||
|
|
@ -95,7 +95,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "org/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -131,7 +131,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "org/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
topicName := fmt.Sprintf("org/%s", objectIdentifier.Identifier)
|
||||
assert.NoError(
|
||||
t,
|
||||
|
|
@ -175,7 +175,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "folder/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -211,7 +211,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "folder/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewFolderAuditEvent(nil)
|
||||
event, objectIdentifier := newFolderAuditEvent(nil)
|
||||
topicName := fmt.Sprintf("folder/%s", objectIdentifier.Identifier)
|
||||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, topicName))
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "project/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewProjectAuditEvent(nil)
|
||||
event, objectIdentifier := newProjectAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -290,7 +290,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "project/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewProjectAuditEvent(nil)
|
||||
event, objectIdentifier := newProjectAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -329,7 +329,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "system/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PRIVATE
|
||||
|
|
@ -382,7 +382,7 @@ func TestRoutableAuditApi(t *testing.T) {
|
|||
assert.NoError(t, solaceContainer.TopicSubscriptionCreate(ctx, queueName, "org/*"))
|
||||
|
||||
// Instantiate test data
|
||||
event, objectIdentifier := NewOrganizationAuditEvent(nil)
|
||||
event, objectIdentifier := newOrganizationAuditEvent(nil)
|
||||
|
||||
// Log the event to solace
|
||||
visibility := auditV1.Visibility_VISIBILITY_PUBLIC
|
||||
|
|
@ -496,7 +496,7 @@ func TestRoutableAuditApi_ValidateAndSerialize_ValidationFailed(t *testing.T) {
|
|||
|
||||
auditApi := routableAuditApi{validator: &protobufValidator}
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
_, err := auditApi.ValidateAndSerialize(event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier)
|
||||
assert.ErrorIs(t, err, expectedError)
|
||||
}
|
||||
|
|
@ -510,7 +510,7 @@ func TestRoutableAuditApi_Log_ValidationFailed(t *testing.T) {
|
|||
|
||||
auditApi := routableAuditApi{validator: &protobufValidator}
|
||||
|
||||
event := NewSystemAuditEvent(nil)
|
||||
event := newSystemAuditEvent(nil)
|
||||
err := auditApi.LogWithTrace(context.Background(), event, auditV1.Visibility_VISIBILITY_PUBLIC, RoutableSystemIdentifier, nil, nil)
|
||||
assert.ErrorIs(t, err, expectedError)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import (
|
|||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
func NewOrganizationAuditEvent(
|
||||
func newOrganizationAuditEvent(
|
||||
customization *func(
|
||||
*auditV1.AuditLogEntry,
|
||||
*auditV1.ObjectIdentifier,
|
||||
|
|
@ -105,7 +105,7 @@ func NewOrganizationAuditEvent(
|
|||
return auditEvent, objectIdentifier
|
||||
}
|
||||
|
||||
func NewFolderAuditEvent(
|
||||
func newFolderAuditEvent(
|
||||
customization *func(
|
||||
*auditV1.AuditLogEntry,
|
||||
*auditV1.ObjectIdentifier,
|
||||
|
|
@ -197,7 +197,7 @@ func NewFolderAuditEvent(
|
|||
return auditEvent, objectIdentifier
|
||||
}
|
||||
|
||||
func NewProjectAuditEvent(
|
||||
func newProjectAuditEvent(
|
||||
customization *func(
|
||||
*auditV1.AuditLogEntry,
|
||||
*auditV1.ObjectIdentifier,
|
||||
|
|
@ -289,7 +289,7 @@ func NewProjectAuditEvent(
|
|||
return auditEvent, objectIdentifier
|
||||
}
|
||||
|
||||
func NewSystemAuditEvent(
|
||||
func newSystemAuditEvent(
|
||||
customization *func(*auditV1.AuditLogEntry)) *auditV1.AuditLogEntry {
|
||||
|
||||
identifier := uuid.Nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue