From 20b346ef9d4fcbbbe05abfe08e4f4f0303b0812e Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期日, 30 八月 2026 20:37:45 +0800
Subject: [PATCH] 实现 Ticket12 人工结束与顺序接入
---
ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TTestServiceImplTest.java | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 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 3538aec..0dd6a09 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
@@ -389,7 +389,9 @@
assertEquals(1, testService.startReception(10L, 7L, "operator"));
verify(testMapper).insertChannelLease(eq(100L), eq(10L), eq(30L), eq(7L), any());
+ verify(testMapper).insertReceptionInterval(eq(10L), eq(30L), eq("CABINET_CHANNEL"), eq(100L), isNull(), any(), eq("RECEPTION_STARTED"));
verify(testMapper, times(3)).insertCollectorChannelLease(eq(8L), any(), eq(10L), eq(30L), eq(7L), any());
+ verify(testMapper, times(3)).insertReceptionInterval(eq(10L), eq(30L), eq("COLLECTOR_CHANNEL"), eq(8L), any(), any(), eq("RECEPTION_STARTED"));
verify(testMapper).insertTestAudit(eq(10L), eq("RECEPTION_STARTED"), eq(7L), eq("operator"), isNull(), any());
}
@@ -532,7 +534,7 @@
}
@Test
- void stopTestShouldTerminateAndReleaseLeases()
+ void stopTestShouldCompleteAndReleaseLeases()
{
TTest current = validTest();
current.setTestId(10L);
@@ -542,10 +544,28 @@
assertEquals(1, testService.stopTest(10L, 7L, "operator"));
verify(testMapper).updateReceptionStopped(eq(10L), eq("operator"), any());
+ verify(testMapper).closeOpenReceptionIntervals(eq(10L), any(), eq("MANUAL_END"));
verify(testMapper).deleteChannelLeasesByTestId(10L);
verify(testMapper).deleteCollectorChannelLeasesByTestId(10L);
verify(testMapper).insertTestAudit(eq(10L), eq("TEST_STOPPED"), eq(7L), eq("operator"), isNull(),
- org.mockito.ArgumentMatchers.argThat(value -> value != null && value.contains("TERMINATED")));
+ org.mockito.ArgumentMatchers.argThat(value -> value != null && value.contains("COMPLETED")));
+ }
+
+ @Test
+ void stopTestShouldAuditImmediateReleaseAndClosedIntervals()
+ {
+ TTest current = validTest();
+ current.setTestId(10L);
+ current.setReceptionStatus("RECEIVING");
+ when(testMapper.selectTestByIdForUpdate(10L)).thenReturn(current);
+ when(testMapper.updateReceptionStopped(eq(10L), eq("operator"), any())).thenReturn(1);
+ when(testMapper.closeOpenReceptionIntervals(eq(10L), any(), eq("MANUAL_END"))).thenReturn(4);
+
+ testService.stopTest(10L, 7L, "operator");
+
+ verify(testMapper).insertTestAudit(eq(10L), eq("TEST_STOPPED"), eq(7L), eq("operator"), isNull(),
+ org.mockito.ArgumentMatchers.argThat(value -> value != null
+ && value.contains("closedIntervals") && value.contains("IMMEDIATE")));
}
private void mockEnabledOptions()
--
Gitblit v1.7.1