|
@@ -231,6 +231,8 @@ class ControllerIntegrationTest {
|
|
|
.content("{\"id\":5}"))
|
|
.content("{\"id\":5}"))
|
|
|
.andExpect(status().isOk())
|
|
.andExpect(status().isOk())
|
|
|
.andExpect(jsonPath("$.code").value(0));
|
|
.andExpect(jsonPath("$.code").value(0));
|
|
|
|
|
+
|
|
|
|
|
+ verify(chartService).deleteChart(5L, 100L);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
@@ -392,7 +394,8 @@ class ControllerIntegrationTest {
|
|
|
.header("Authorization", "Bearer " + userToken)
|
|
.header("Authorization", "Bearer " + userToken)
|
|
|
.contentType(MediaType.APPLICATION_JSON))
|
|
.contentType(MediaType.APPLICATION_JSON))
|
|
|
.andExpect(status().isOk())
|
|
.andExpect(status().isOk())
|
|
|
- .andExpect(jsonPath("$.code").value(1001));
|
|
|
|
|
|
|
+ .andExpect(jsonPath("$.code").value(1001))
|
|
|
|
|
+ .andExpect(jsonPath("$.message").value("Admin access required"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ==================== Error Handling ====================
|
|
// ==================== Error Handling ====================
|
|
@@ -424,7 +427,8 @@ class ControllerIntegrationTest {
|
|
|
.header("Authorization", "Bearer " + userToken))
|
|
.header("Authorization", "Bearer " + userToken))
|
|
|
.andExpect(status().isOk())
|
|
.andExpect(status().isOk())
|
|
|
.andExpect(jsonPath("$.code").value(0))
|
|
.andExpect(jsonPath("$.code").value(0))
|
|
|
- .andExpect(jsonPath("$.data.nickname").value("测试用户"));
|
|
|
|
|
|
|
+ .andExpect(jsonPath("$.data.nickname").value("测试用户"))
|
|
|
|
|
+ .andExpect(jsonPath("$.data.avatarUrl").value("http://avatar.url"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|