Skip to content

Commit db5a231

Browse files
committed
Revert "Fix TaskAdminControllerIntegrationTest"
This reverts commit f5a69d7. Add order annotation to task details test
1 parent 6a24203 commit db5a231

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/test/java/org/tailormap/api/controller/admin/TaskAdminControllerIntegrationTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package org.tailormap.api.controller.admin;
77

88
import static org.hamcrest.Matchers.anyOf;
9-
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
109
import static org.hamcrest.Matchers.is;
1110
import static org.junit.jupiter.api.Assertions.assertEquals;
1211
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -74,7 +73,7 @@ void list_all_tasks() throws Exception {
7473
.andExpect(status().isOk())
7574
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
7675
.andExpect(jsonPath("$.tasks").isArray())
77-
.andExpect(jsonPath("$.tasks.length()").value(greaterThanOrEqualTo(4)))
76+
.andExpect(jsonPath("$.tasks.length()").value(4))
7877
// value is any of the available task types
7978
.andExpect(jsonPath("$.tasks[0].type")
8079
.value(anyOf(
@@ -123,7 +122,7 @@ void list_tasks_for_existing_type() throws Exception {
123122
.andExpect(status().isOk())
124123
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
125124
.andExpect(jsonPath("$.tasks").isArray())
126-
.andExpect(jsonPath("$.tasks.length()").value(greaterThanOrEqualTo(2)))
125+
.andExpect(jsonPath("$.tasks.length()").value(2))
127126
.andExpect(jsonPath("$.tasks[0].type").value(TEST_TASK_TYPE))
128127
.andExpect(jsonPath("$.tasks[1].type").value(TEST_TASK_TYPE))
129128
.andReturn();
@@ -154,14 +153,15 @@ void list_tasks_for_non_existent_type() throws Exception {
154153
@WithMockUser(
155154
username = "tm-admin",
156155
authorities = {Group.ADMIN})
156+
@Order(1)
157157
void details_of_task() throws Exception {
158158
MvcResult result = mockMvc.perform(get(adminBasePath + "/tasks")
159159
.queryParam(TYPE_KEY, TEST_TASK_TYPE)
160160
.accept(MediaType.APPLICATION_JSON))
161161
.andExpect(status().isOk())
162162
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
163163
.andExpect(jsonPath("$.tasks").isArray())
164-
.andExpect(jsonPath("$.tasks.length()").value(greaterThanOrEqualTo(2)))
164+
.andExpect(jsonPath("$.tasks.length()").value(2))
165165
.andReturn();
166166

167167
final String detailsUUID = JsonPath.read(result.getResponse().getContentAsString(), "$.tasks[0].uuid");
@@ -201,7 +201,7 @@ void stop_unstoppable_task() throws Exception {
201201
.andExpect(status().isOk())
202202
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
203203
.andExpect(jsonPath("$.tasks").isArray())
204-
.andExpect(jsonPath("$.tasks.length()").value(greaterThanOrEqualTo(2)))
204+
.andExpect(jsonPath("$.tasks.length()").value(2))
205205
.andReturn();
206206

207207
final String unstoppableUUID = JsonPath.read(result.getResponse().getContentAsString(), "$.tasks[0].uuid");
@@ -241,7 +241,7 @@ void delete_task() throws Exception {
241241
.andExpect(status().isOk())
242242
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
243243
.andExpect(jsonPath("$.tasks").isArray())
244-
.andExpect(jsonPath("$.tasks.length()").value(greaterThanOrEqualTo(2)))
244+
.andExpect(jsonPath("$.tasks.length()").value(2))
245245
.andReturn();
246246

247247
final String deleteUUID = JsonPath.read(result.getResponse().getContentAsString(), "$.tasks[0].uuid");
@@ -263,7 +263,7 @@ void delete_search_index_task() throws Exception {
263263
.andExpect(status().isOk())
264264
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
265265
.andExpect(jsonPath("$.tasks").isArray())
266-
.andExpect(jsonPath("$.tasks.length()").value(greaterThanOrEqualTo(1)))
266+
.andExpect(jsonPath("$.tasks.length()").value(1))
267267
.andReturn();
268268

269269
final String deleteUUID = JsonPath.read(result.getResponse().getContentAsString(), "$.tasks[0].uuid");

0 commit comments

Comments
 (0)