| | |
| | | } |
| | | |
| | | @Test |
| | | void offlineCollectorCanBeRegisteredWithoutChangingOnlineFact() |
| | | { |
| | | java.time.Instant now = java.time.Instant.now(); |
| | | candidateStore.replaceCollectors("dev-sim", java.util.List.of(new CollectorCandidate( |
| | | "dev-sim", "COL-001", "192.168.1.10", "AA:BB:CC:DD:EE:FF", "一号采集器", |
| | | "开发模拟器", "Virtual Collector", 8, false, now, now.plusSeconds(60)))); |
| | | when(collectorMapper.insertCollector(any(TCollector.class))).thenReturn(1); |
| | | assertEquals(1, collectorService.insertCollector(collector)); |
| | | verify(collectorMapper).updateRegisteredObservation("COL-001", "OFFLINE"); |
| | | } |
| | | |
| | | @Test |
| | | void insertCollectorShouldRejectDuplicateCode() |
| | | { |
| | | collector.setCollectorId(null); |