|
16 | 16 |
|
17 | 17 | package com.epam.reportportal.ws.controller; |
18 | 18 |
|
| 19 | +import static org.hamcrest.Matchers.allOf; |
| 20 | +import static org.hamcrest.Matchers.hasEntry; |
| 21 | +import static org.hamcrest.Matchers.hasItem; |
19 | 22 | import static org.hamcrest.Matchers.hasSize; |
20 | 23 | import static org.junit.jupiter.api.Assertions.assertEquals; |
21 | 24 | import static org.junit.jupiter.api.Assertions.assertTrue; |
@@ -772,15 +775,21 @@ void getActivityStreamWidget() throws Exception { |
772 | 775 | .andExpect(content().contentType("application/json")) |
773 | 776 | .andExpect(jsonPath("$.name").value("activity stream")) |
774 | 777 | .andExpect(jsonPath("$.widgetType").value("activityStream")) |
775 | | - .andExpect(jsonPath("$.content.result[2].user").value(SUPERADMIN_USERNAME)) |
776 | | - .andExpect(jsonPath("$.content.result[2].actionType").value("startLaunch")) |
777 | | - .andExpect(jsonPath("$.content.result[2].objectType").value("LAUNCH")) |
778 | | - .andExpect(jsonPath("$.content.result[1].user").value(SUPERADMIN_USERNAME)) |
779 | | - .andExpect(jsonPath("$.content.result[1].actionType").value("updateItem")) |
780 | | - .andExpect(jsonPath("$.content.result[1].objectType").value("ITEM")) |
781 | | - .andExpect(jsonPath("$.content.result[0].user").value(SUPERADMIN_USERNAME)) |
782 | | - .andExpect(jsonPath("$.content.result[0].actionType").value("deleteLaunch")) |
783 | | - .andExpect(jsonPath("$.content.result[0].objectType").value("LAUNCH")); |
| 778 | + .andExpect(jsonPath("$.content.result", hasItem(allOf( |
| 779 | + hasEntry("user", SUPERADMIN_USERNAME), |
| 780 | + hasEntry("actionType", "startLaunch"), |
| 781 | + hasEntry("objectType", "LAUNCH") |
| 782 | + )))) |
| 783 | + .andExpect(jsonPath("$.content.result", hasItem(allOf( |
| 784 | + hasEntry("user", SUPERADMIN_USERNAME), |
| 785 | + hasEntry("actionType", "updateItem"), |
| 786 | + hasEntry("objectType", "ITEM") |
| 787 | + )))) |
| 788 | + .andExpect(jsonPath("$.content.result", hasItem(allOf( |
| 789 | + hasEntry("user", SUPERADMIN_USERNAME), |
| 790 | + hasEntry("actionType", "deleteLaunch"), |
| 791 | + hasEntry("objectType", "LAUNCH") |
| 792 | + )))); |
784 | 793 | } |
785 | 794 |
|
786 | 795 | @Sql("/db/widget/activity-stream.sql") |
@@ -809,15 +818,21 @@ void getActivityStreamWidgetWithEmptyUserOption() throws Exception { |
809 | 818 | .andExpect(content().contentType("application/json")) |
810 | 819 | .andExpect(jsonPath("$.name").value("activity stream")) |
811 | 820 | .andExpect(jsonPath("$.widgetType").value("activityStream")) |
812 | | - .andExpect(jsonPath("$.content.result[2].user").value(SUPERADMIN_USERNAME)) |
813 | | - .andExpect(jsonPath("$.content.result[2].actionType").value("startLaunch")) |
814 | | - .andExpect(jsonPath("$.content.result[2].objectType").value("LAUNCH")) |
815 | | - .andExpect(jsonPath("$.content.result[1].user").value(SUPERADMIN_USERNAME)) |
816 | | - .andExpect(jsonPath("$.content.result[1].actionType").value("updateItem")) |
817 | | - .andExpect(jsonPath("$.content.result[1].objectType").value("ITEM")) |
818 | | - .andExpect(jsonPath("$.content.result[0].user").value(SUPERADMIN_USERNAME)) |
819 | | - .andExpect(jsonPath("$.content.result[0].actionType").value("deleteLaunch")) |
820 | | - .andExpect(jsonPath("$.content.result[0].objectType").value("LAUNCH")); |
| 821 | + .andExpect(jsonPath("$.content.result", hasItem(allOf( |
| 822 | + hasEntry("user", SUPERADMIN_USERNAME), |
| 823 | + hasEntry("actionType", "startLaunch"), |
| 824 | + hasEntry("objectType", "LAUNCH") |
| 825 | + )))) |
| 826 | + .andExpect(jsonPath("$.content.result", hasItem(allOf( |
| 827 | + hasEntry("user", SUPERADMIN_USERNAME), |
| 828 | + hasEntry("actionType", "updateItem"), |
| 829 | + hasEntry("objectType", "ITEM") |
| 830 | + )))) |
| 831 | + .andExpect(jsonPath("$.content.result", hasItem(allOf( |
| 832 | + hasEntry("user", SUPERADMIN_USERNAME), |
| 833 | + hasEntry("actionType", "deleteLaunch"), |
| 834 | + hasEntry("objectType", "LAUNCH") |
| 835 | + )))); |
821 | 836 | } |
822 | 837 |
|
823 | 838 | @Sql("/db/widget/product-status.sql") |
|
0 commit comments