|
@@ -171,6 +171,17 @@ class CockpitVideoControllerTest {
|
|
|
.andExpect(jsonPath("$.data.records").isEmpty());
|
|
.andExpect(jsonPath("$.data.records").isEmpty());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void aFailedRecordingQueryIsItsOwnCategoryNotAGenericVideoRead() throws Exception {
|
|
|
|
|
+ when(collector.get(RECORD_QUERY, Map.of("deviceId", GB, "channelId", CHANNEL,
|
|
|
|
|
+ "startTime", "2026-11-10 00:00:00", "endTime", "2026-11-10 12:00:00", "type", "all")))
|
|
|
|
|
+ .thenThrow(new ServiceException("查询录像失败"));
|
|
|
|
|
+ mvc.perform(get(ROOT + "/records").param("deviceCode", CODE)
|
|
|
|
|
+ .param("startTime", "2026-11-10 00:00:00").param("endTime", "2026-11-10 12:00:00"))
|
|
|
|
|
+ .andExpect(status().isBadGateway())
|
|
|
|
|
+ .andExpect(jsonPath("$.data.category").value("VIDEO_RECORDS_FAILED"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Test
|
|
@Test
|
|
|
void recordingRangeOverSevenDaysIsRejectedBeforeTouchingTheDevice() throws Exception {
|
|
void recordingRangeOverSevenDaysIsRejectedBeforeTouchingTheDevice() throws Exception {
|
|
|
mvc.perform(get(ROOT + "/records").param("deviceCode", CODE)
|
|
mvc.perform(get(ROOT + "/records").param("deviceCode", CODE)
|