From 96144b97e1761db230c0dc61a837ec55d76210df Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期三, 02 九月 2026 15:50:55 +0800
Subject: [PATCH] 允许离线设备进入接收状态

---
 ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TestDataReceptionServiceImplTest.java |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TestDataReceptionServiceImplTest.java b/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TestDataReceptionServiceImplTest.java
index 794525c..3992beb 100644
--- a/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TestDataReceptionServiceImplTest.java
+++ b/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TestDataReceptionServiceImplTest.java
@@ -6,6 +6,7 @@
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -51,6 +52,25 @@
                 any(byte[].class));
     }
 
+    @Test
+    void doesNotWriteSamplesWhenNoSuccessfulRecordsAreAvailable()
+    {
+        TTestMapper mapper = mock(TTestMapper.class);
+        ITTestService tests = mock(ITTestService.class);
+        BtsDevelopmentSimulator simulator = mock(BtsDevelopmentSimulator.class);
+        TTest test = test(Date.from(Instant.parse("2026-09-02T04:00:00Z")));
+        when(mapper.selectReceivingTestIds()).thenReturn(List.of(1L));
+        when(mapper.selectTestByIdForUpdate(1L)).thenReturn(test);
+        when(tests.selectTestById(1L)).thenReturn(test);
+        when(simulator.btsRecords(1, 1)).thenReturn(List.of());
+
+        new TestDataReceptionServiceImpl(mapper, tests, simulator).captureDevelopmentCabinetRecords();
+
+        verify(mapper, never()).insertBtsSample(any(), any(), any(), anyString(), any(), any(Date.class), anyString(),
+                any(Date.class), anyInt(), anyInt(), anyString(), anyString(), isNull(), any(BigDecimal.class),
+                any(BigDecimal.class), any(BigDecimal.class), any(BigDecimal.class), any(byte[].class));
+    }
+
     private static TTest test(Date startedAt)
     {
         TTestChannelBinding binding = new TTestChannelBinding();

--
Gitblit v1.7.1