diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectStatusFlowSettingControllerTest.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectStatusFlowSettingControllerTest.java index c95ce74f58..c8bf63fbc7 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectStatusFlowSettingControllerTest.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectStatusFlowSettingControllerTest.java @@ -29,7 +29,9 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.servlet.MvcResult; +import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; import static io.metersphere.project.enums.result.ProjectResultCode.PROJECT_TEMPLATE_PERMISSION; import static io.metersphere.system.controller.handler.result.CommonResultCode.STATUS_ITEM_EXIST; @@ -302,7 +304,8 @@ public class ProjectStatusFlowSettingControllerTest extends BaseTest { @Order(6) public void sortStatusItem() throws Exception { List statusItems = baseStatusItemService.getByScopeIdAndScene(DEFAULT_PROJECT_ID, TemplateScene.BUG.name()); - List statusIds = statusItems.stream().map(StatusItem::getId).toList().reversed(); + List statusIds = statusItems.stream().map(StatusItem::getId).collect(Collectors.toList()); + Collections.reverse(statusIds); // @@校验请求成功 this.requestPostWithOkAndReturn(STATUS_SORT, statusIds, DEFAULT_PROJECT_ID, TemplateScene.BUG.name()); OrganizationStatusFlowSettingControllerTest.assertSortStatusItem(DEFAULT_PROJECT_ID, statusIds); diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationStatusFlowSettingControllerTest.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationStatusFlowSettingControllerTest.java index e3dd288bc5..53fba03fbc 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationStatusFlowSettingControllerTest.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationStatusFlowSettingControllerTest.java @@ -30,6 +30,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.servlet.MvcResult; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -393,7 +394,8 @@ public class OrganizationStatusFlowSettingControllerTest extends BaseTest { @Order(6) public void sortStatusItem() throws Exception { List statusItems = baseStatusItemService.getByScopeIdAndScene(DEFAULT_ORGANIZATION_ID, TemplateScene.BUG.name()); - List statusIds = statusItems.stream().map(StatusItem::getId).toList().reversed(); + List statusIds = statusItems.stream().map(StatusItem::getId).collect(Collectors.toList()); + Collections.reverse(statusIds); // @@校验请求成功 this.requestPostWithOkAndReturn(STATUS_SORT, statusIds, DEFAULT_ORGANIZATION_ID, TemplateScene.BUG.name()); assertSortStatusItem(DEFAULT_ORGANIZATION_ID, statusIds);