From 2651949754a60afae6152977a0f83a1b4704cba5 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期四, 27 八月 2026 20:57:17 +0800
Subject: [PATCH] fix(test): address configuration review findings
---
ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TTestServiceImplTest.java | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TTestServiceImplTest.java b/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TTestServiceImplTest.java
index 71aa715..ff783a5 100644
--- a/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TTestServiceImplTest.java
+++ b/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TTestServiceImplTest.java
@@ -4,6 +4,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.never;
@@ -198,6 +199,20 @@
verify(testMapper).insertTestAudit(anyLong(), any(), anyLong(), any(), any(), any());
}
+ @Test
+ void deleteBeforeMonitoringShouldAppendAudit()
+ {
+ TTest current = validTest();
+ current.setTestId(10L);
+ current.setMonitoringStatus("NOT_MONITORED");
+ when(testMapper.selectTestByIdForUpdate(10L)).thenReturn(current);
+ when(testMapper.deleteTestById(10L, "operator")).thenReturn(1);
+
+ assertEquals(1, testService.deleteTestByIds(new Long[] { 10L }, 7L, "operator"));
+
+ verify(testMapper).insertTestAudit(eq(10L), eq("TEST_DELETED"), eq(7L), eq("operator"), any(), isNull());
+ }
+
private void mockEnabledOptions()
{
mockEnabledPeopleAndType();
--
Gitblit v1.7.1