--- src/test/java/kr/itn/itnhub/dashboard/DashboardControllerTest.java
+++ src/test/java/kr/itn/itnhub/dashboard/DashboardControllerTest.java
... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 |
import org.springframework.security.test.context.support.WithMockUser; |
| 14 | 14 |
import org.springframework.test.web.servlet.MockMvc; |
| 15 | 15 |
|
| 16 |
+import static org.hamcrest.Matchers.hasItem; |
|
| 16 | 17 |
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; |
| 17 | 18 |
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; |
| 18 | 19 |
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
... | ... | @@ -134,7 +135,9 @@ |
| 134 | 135 |
mvc.perform(get("/api/dashboard"))
|
| 135 | 136 |
.andExpect(status().isOk()) |
| 136 | 137 |
.andExpect(jsonPath("$.rights.reviewSourceKoglTypes[0].label").value("미부착"))
|
| 137 |
- .andExpect(jsonPath("$.rights.reviewJudgedKoglTypes[0].label").value("2유형"))
|
|
| 138 |
+ // 동률 항목의 정렬은 DB locale에 따라 달라질 수 있으므로 순서가 아닌 집계값을 검증한다. |
|
| 139 |
+ .andExpect(jsonPath("$.rights.reviewJudgedKoglTypes[*].label", hasItem("2유형")))
|
|
| 140 |
+ .andExpect(jsonPath("$.rights.reviewJudgedKoglTypes[?(@.label == '2유형')].count", hasItem(1)))
|
|
| 138 | 141 |
.andExpect(jsonPath("$.rights.processTypes.length()").value(2))
|
| 139 | 142 |
.andExpect(jsonPath("$.rights.processStatuses.length()").value(2))
|
| 140 | 143 |
.andExpect(jsonPath("$.rights.changedKoglCount").value(1))
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?