From 4f9b3aa211f88fb9491115f57483adde14f47830 Mon Sep 17 00:00:00 2001 From: marsal Date: Tue, 7 Jul 2026 11:25:07 +0800 Subject: [PATCH] fix(test): use Spring Boot 4 AutoConfigureMockMvc package and remove stub --- .../controller/AccountControllerTest.java | 2 +- .../web/servlet/AutoConfigureMockMvc.java | 22 ------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 backend/mci-server/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java diff --git a/backend/mci-server/src/test/java/com/sino/mci/admin/controller/AccountControllerTest.java b/backend/mci-server/src/test/java/com/sino/mci/admin/controller/AccountControllerTest.java index ec7e7ea..677aee9 100644 --- a/backend/mci-server/src/test/java/com/sino/mci/admin/controller/AccountControllerTest.java +++ b/backend/mci-server/src/test/java/com/sino/mci/admin/controller/AccountControllerTest.java @@ -2,7 +2,7 @@ package com.sino.mci.admin.controller; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; diff --git a/backend/mci-server/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java b/backend/mci-server/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java deleted file mode 100644 index b4efd8c..0000000 --- a/backend/mci-server/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.springframework.boot.test.autoconfigure.web.servlet; - -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -@ImportAutoConfiguration({ - org.springframework.boot.webmvc.test.autoconfigure.MockMvcAutoConfiguration.class, - org.springframework.boot.webmvc.test.autoconfigure.MockMvcWebClientAutoConfiguration.class, - org.springframework.boot.webmvc.test.autoconfigure.MockMvcWebDriverAutoConfiguration.class -}) -public @interface AutoConfigureMockMvc { -}