From 147428971be43eed90a79f3849f15000d3855390 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期一, 28 九月 2026 15:15:22 +0800
Subject: [PATCH] 实现新威 7.6 直连取数与逐行接收
---
ruoyi-admin/src/test/java/com/battery/business/service/impl/TestDataReceptionServiceImplTest.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/ruoyi-admin/src/test/java/com/battery/business/service/impl/TestDataReceptionServiceImplTest.java b/ruoyi-admin/src/test/java/com/battery/business/service/impl/TestDataReceptionServiceImplTest.java
index 540bb5b..c6eb367 100644
--- a/ruoyi-admin/src/test/java/com/battery/business/service/impl/TestDataReceptionServiceImplTest.java
+++ b/ruoyi-admin/src/test/java/com/battery/business/service/impl/TestDataReceptionServiceImplTest.java
@@ -59,13 +59,13 @@
Clock clock = mock(Clock.class);
when(clock.instant()).thenReturn(CAPTURED_AT);
var service = new TestDataReceptionServiceImpl(fixture.mapper, fixture.tests, fixture.simulator, clock);
- when(fixture.simulator.latestCollector("collector-9")).thenReturn(collectorSnapshot(true,
+ when(fixture.simulator.latestCollector(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.eq("collector-9"))).thenReturn(collectorSnapshot(true,
List.of(collector("S-01", 10L, "temperature", "25.1", "℃"))));
when(fixture.mapper.insertRealtimeRecord(any())).thenReturn(1);
service.captureReceivedData();
when(clock.instant()).thenReturn(CAPTURED_AT.plusSeconds(5));
- when(fixture.simulator.latestCollector("collector-9")).thenReturn(collectorSnapshot(true,
+ when(fixture.simulator.latestCollector(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.eq("collector-9"))).thenReturn(collectorSnapshot(true,
List.of(collector("S-01", 11L, "temperature", "38", "℃"))));
service.captureReceivedData();
@@ -87,7 +87,7 @@
test.getBatteries().get(0).setCollectorChannels(List.of(
mapping("PRIMARY_TEMPERATURE", "S-01"), mapping("SECONDARY_TEMPERATURE_2", "S-03"),
mapping("SECONDARY_TEMPERATURE_3", "S-05")));
- when(fixture.simulator.latestCollector("collector-9")).thenReturn(collectorSnapshot(true, List.of(
+ when(fixture.simulator.latestCollector(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.eq("collector-9"))).thenReturn(collectorSnapshot(true, List.of(
collector("S-01", 10L, "temperature", "38", "℃"),
collector("S-03", 10L, "temperature", "25.3", "℃"),
collector("S-05", 10L, "temperature", "25.5", "℃"))));
@@ -125,7 +125,7 @@
{
Fixture fixture = fixture();
when(fixture.simulator.latestCabinet(any(ChannelIdentity.class))).thenReturn(cabinetRecord());
- when(fixture.simulator.latestCollector("collector-9")).thenReturn(collectorSnapshot(true, List.of(
+ when(fixture.simulator.latestCollector(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.eq("collector-9"))).thenReturn(collectorSnapshot(true, List.of(
collector("S-01", 10L, "TEMPERATURE", "25.100", "℃"),
collector("S-02", 10L, "POSITIVE_POTENTIAL", "1.620", "V"),
collector("S-03", 10L, "NEGATIVE_POTENTIAL", "1.610", "V"),
@@ -159,7 +159,7 @@
{
Fixture fixture = fixture();
when(fixture.simulator.latestCabinet(any(ChannelIdentity.class))).thenThrow(new IllegalArgumentException("offline"));
- when(fixture.simulator.latestCollector("collector-9")).thenReturn(collectorSnapshot(true,
+ when(fixture.simulator.latestCollector(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.eq("collector-9"))).thenReturn(collectorSnapshot(true,
List.of(collector("S-01", 11L, "TEMPERATURE", "26.2", "℃"))));
when(fixture.mapper.insertRealtimeRecord(any())).thenReturn(1);
@@ -216,7 +216,7 @@
{
Fixture fixture = fixture();
when(fixture.simulator.latestCabinet(any(ChannelIdentity.class))).thenReturn(cabinetRecord());
- when(fixture.simulator.latestCollector("collector-9")).thenReturn(collectorSnapshot(false, List.of()));
+ when(fixture.simulator.latestCollector(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.eq("collector-9"))).thenReturn(collectorSnapshot(false, List.of()));
when(fixture.mapper.insertRealtimeRecord(any())).thenReturn(1);
fixture.service().captureReceivedData();
@@ -235,7 +235,7 @@
{
Fixture fixture = fixture();
when(fixture.simulator.latestCabinet(any(ChannelIdentity.class))).thenReturn(cabinetRecord());
- when(fixture.simulator.latestCollector("collector-9")).thenReturn(collectorSnapshot(false, List.of()));
+ when(fixture.simulator.latestCollector(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.eq("collector-9"))).thenReturn(collectorSnapshot(false, List.of()));
when(fixture.mapper.selectRealtimeRecordContentHash(eq(1L), eq(4L), any(Date.class)))
.thenReturn("different-content");
--
Gitblit v1.7.1