MCPcopy Create free account
hub / github.com/astercloud/aster / TestInMemoryAuditLog_Close

Function TestInMemoryAuditLog_Close

pkg/security/audit_test.go:283–294  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

281}
282
283func TestInMemoryAuditLog_Close(t *testing.T) {
284 auditLog := NewInMemoryAuditLog(nil)
285
286 // 添加一个事件
287 _ = auditLog.LogEvent(AuditEvent{Type: AuditTypeUserLogin, UserID: "user1"})
288
289 // 关闭
290 err := auditLog.Close()
291 if err != nil {
292 t.Fatalf("Close failed: %v", err)
293 }
294}
295
296func TestInMemoryAuditLog_ConcurrentWrites(t *testing.T) {
297 auditLog := NewInMemoryAuditLog(nil)

Callers

nothing calls this directly

Calls 3

LogEventMethod · 0.95
CloseMethod · 0.95
NewInMemoryAuditLogFunction · 0.85

Tested by

no test coverage detected