66package org .tailormap .api .controller .admin ;
77
88import static org .hamcrest .Matchers .anyOf ;
9+ import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
910import static org .hamcrest .Matchers .is ;
1011import static org .junit .jupiter .api .Assertions .assertEquals ;
1112import static org .junit .jupiter .api .Assertions .assertTrue ;
@@ -73,7 +74,7 @@ void list_all_tasks() throws Exception {
7374 .andExpect (status ().isOk ())
7475 .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
7576 .andExpect (jsonPath ("$.tasks" ).isArray ())
76- .andExpect (jsonPath ("$.tasks.length()" ).value (4 ))
77+ .andExpect (jsonPath ("$.tasks.length()" ).value (greaterThanOrEqualTo ( 4 ) ))
7778 // value is any of the available task types
7879 .andExpect (jsonPath ("$.tasks[0].type" )
7980 .value (anyOf (
@@ -122,7 +123,7 @@ void list_tasks_for_existing_type() throws Exception {
122123 .andExpect (status ().isOk ())
123124 .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
124125 .andExpect (jsonPath ("$.tasks" ).isArray ())
125- .andExpect (jsonPath ("$.tasks.length()" ).value (2 ))
126+ .andExpect (jsonPath ("$.tasks.length()" ).value (greaterThanOrEqualTo ( 2 ) ))
126127 .andExpect (jsonPath ("$.tasks[0].type" ).value (TEST_TASK_TYPE ))
127128 .andExpect (jsonPath ("$.tasks[1].type" ).value (TEST_TASK_TYPE ))
128129 .andReturn ();
@@ -160,7 +161,7 @@ void details_of_task() throws Exception {
160161 .andExpect (status ().isOk ())
161162 .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
162163 .andExpect (jsonPath ("$.tasks" ).isArray ())
163- .andExpect (jsonPath ("$.tasks.length()" ).value (2 ))
164+ .andExpect (jsonPath ("$.tasks.length()" ).value (greaterThanOrEqualTo ( 2 ) ))
164165 .andReturn ();
165166
166167 final String detailsUUID = JsonPath .read (result .getResponse ().getContentAsString (), "$.tasks[0].uuid" );
@@ -200,7 +201,7 @@ void stop_unstoppable_task() throws Exception {
200201 .andExpect (status ().isOk ())
201202 .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
202203 .andExpect (jsonPath ("$.tasks" ).isArray ())
203- .andExpect (jsonPath ("$.tasks.length()" ).value (2 ))
204+ .andExpect (jsonPath ("$.tasks.length()" ).value (greaterThanOrEqualTo ( 2 ) ))
204205 .andReturn ();
205206
206207 final String unstoppableUUID = JsonPath .read (result .getResponse ().getContentAsString (), "$.tasks[0].uuid" );
@@ -240,7 +241,7 @@ void delete_task() throws Exception {
240241 .andExpect (status ().isOk ())
241242 .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
242243 .andExpect (jsonPath ("$.tasks" ).isArray ())
243- .andExpect (jsonPath ("$.tasks.length()" ).value (2 ))
244+ .andExpect (jsonPath ("$.tasks.length()" ).value (greaterThanOrEqualTo ( 2 ) ))
244245 .andReturn ();
245246
246247 final String deleteUUID = JsonPath .read (result .getResponse ().getContentAsString (), "$.tasks[0].uuid" );
@@ -262,7 +263,7 @@ void delete_search_index_task() throws Exception {
262263 .andExpect (status ().isOk ())
263264 .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
264265 .andExpect (jsonPath ("$.tasks" ).isArray ())
265- .andExpect (jsonPath ("$.tasks.length()" ).value (1 ))
266+ .andExpect (jsonPath ("$.tasks.length()" ).value (greaterThanOrEqualTo ( 1 ) ))
266267 .andReturn ();
267268
268269 final String deleteUUID = JsonPath .read (result .getResponse ().getContentAsString (), "$.tasks[0].uuid" );
0 commit comments