Просмотр исходного кода

test(video): 修正匿名端点契约测试名并断言录像类型

Kazerin 3 недель назад
Родитель
Сommit
d1f3257669

+ 3 - 2
pipe-network-service/zksy-admin/src/test/java/com/zksy/web/controller/cockpit/CockpitVideoControllerTest.java

@@ -155,7 +155,8 @@ class CockpitVideoControllerTest {
                 .andExpect(jsonPath("$.data.empty").value(false))
                 .andExpect(jsonPath("$.data.records[0].name").value("通道01"))
                 .andExpect(jsonPath("$.data.records[0].startTime").value("2026-11-10 01:00:00"))
-                .andExpect(jsonPath("$.data.records[0].endTime").value("2026-11-10 02:00:00"));
+                .andExpect(jsonPath("$.data.records[0].endTime").value("2026-11-10 02:00:00"))
+                .andExpect(jsonPath("$.data.records[0].type").value("time"));
     }
 
     @Test
@@ -270,7 +271,7 @@ class CockpitVideoControllerTest {
             "GET,/devices/remove", "GET,/record", "POST,/device", "PUT,/live", "DELETE,/live",
             "POST,/sessions/example/control", "POST,/ptz", "POST,/playback/control", "POST,/devices",
             "POST,/sessions/example/nested/stop", "POST,/live/nested"})
-    void onlyTheSixPublishedMethodAndPathPairsAreAnonymous(String method, String path) throws Exception {
+    void unpublishedVideoMethodAndPathPairsRequireAuthentication(String method, String path) throws Exception {
         mvc.perform(request(org.springframework.http.HttpMethod.valueOf(method), ROOT + path))
                 .andExpect(status().isUnauthorized()).andExpect(jsonPath("$.code").value(401));
         verifyNoInteractions(devices, bindings, sessions, collector);