From 7d8ff3e5ba99e76fc88faf7f53cc0630e3c6381f Mon Sep 17 00:00:00 2001 From: cnathe Date: Thu, 31 Jul 2025 09:26:54 -0500 Subject: [PATCH] AuditLogHelper.checkAuditEventDiffCountForLastTransaction debugging for unexpected number of events case --- src/org/labkey/test/util/AuditLogHelper.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/org/labkey/test/util/AuditLogHelper.java b/src/org/labkey/test/util/AuditLogHelper.java index 97ddce324e..500bcb6acd 100644 --- a/src/org/labkey/test/util/AuditLogHelper.java +++ b/src/org/labkey/test/util/AuditLogHelper.java @@ -248,10 +248,14 @@ public Integer checkAuditEventDiffCountForLastTransaction(String containerPath, { Integer transactionId = getLastTransactionId(containerPath, auditEventName); List transactionFilter = List.of(new Filter("TransactionId", transactionId, Filter.Operator.EQUAL)); - int eventCount = getAuditLogsFromLKS(containerPath, auditEventName, List.of("NewRecordMap"), transactionFilter, null, ContainerFilter.CurrentAndSubfolders).getRows().size(); + List> events = getAuditLogsFromLKS(containerPath, auditEventName, List.of("Comment", "UserComment", "NewRecordMap"), transactionFilter, null, ContainerFilter.CurrentAndSubfolders).getRows(); if (expectedEventCount != null) - assertEquals("Unexpected number of events for transactionId " + transactionId, expectedEventCount.intValue(), eventCount); - List expectedChangeCounts = Collections.nCopies(eventCount, expectedDiffCount); + { + if (expectedEventCount.intValue() != events.size()) + TestLogger.log("Last audit event info: " + events.get(0)); + assertEquals("Unexpected number of events for transactionId " + transactionId, expectedEventCount.intValue(), events.size()); + } + List expectedChangeCounts = Collections.nCopies(events.size(), expectedDiffCount); checkAuditEventDiffCount(containerPath, auditEventName, transactionFilter, expectedChangeCounts); return transactionId; }