|
|
@@ -11,6 +11,9 @@ import com.zksy.cockpit.map.BusinessCockpitMapSnapshotAdapter;
|
|
|
import com.zksy.cockpit.map.CockpitMapSnapshot;
|
|
|
import com.zksy.cockpit.map.CockpitMapSnapshotService;
|
|
|
import com.zksy.cockpit.point.BusinessCockpitDeviceFactResolver;
|
|
|
+import com.zksy.cockpit.point.CockpitMonitoringPointDetailAdapter;
|
|
|
+import com.zksy.cockpit.point.CockpitMonitoringPointDetailService;
|
|
|
+import com.zksy.cockpit.point.CockpitMonitoringPointDeviceCard;
|
|
|
import com.zksy.cockpit.point.CockpitMonitoringPointDeviceSnapshot;
|
|
|
import com.zksy.framework.config.FastJson2JsonRedisSerializer;
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
@@ -264,9 +267,18 @@ class BusinessCockpitMapSnapshotAdapterTest {
|
|
|
.thenReturn(Collections.singletonList(firstDevice));
|
|
|
var secondPage = service.load("req", 2, 1, snapshotAt, null, null, null);
|
|
|
|
|
|
+ CockpitMonitoringPointDetailService detailService = new CockpitMonitoringPointDetailService(
|
|
|
+ mock(CockpitMonitoringPointDetailAdapter.class), adapter,
|
|
|
+ Clock.fixed(Instant.parse("2026-09-02T02:00:00Z"), ZoneOffset.UTC));
|
|
|
+ var detail = detailService.load("req", "POINT-2", snapshotAt);
|
|
|
+
|
|
|
assertEquals("POINT-2", secondPage.getMonitoringPoints().get(0).getPointCode());
|
|
|
assertEquals(Collections.singletonList("DEVICE-2"),
|
|
|
secondPage.getMonitoringPoints().get(0).getDeviceCodes());
|
|
|
+ assertEquals(secondPage.getMonitoringPoints().get(0).getDeviceCodes(),
|
|
|
+ detail.getDevices().stream()
|
|
|
+ .map(CockpitMonitoringPointDeviceCard::getDeviceCode)
|
|
|
+ .collect(java.util.stream.Collectors.toList()));
|
|
|
}
|
|
|
|
|
|
@Test
|