From ca40ac7c60c167743f90e87f8a985d024a8fb03c Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 16 Aug 2023 14:45:04 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E5=8E=BB=E6=8E=89=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E6=8E=A7=E5=88=B6=E5=8F=B0=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/resources/application.properties | 6 ++--- .../bug/controller/BugControllerTest.java | 6 ++--- .../src/test/resources/application.properties | 6 ++--- .../controller/CaseReviewControllerTests.java | 4 +-- .../src/test/resources/application.properties | 6 ++--- .../controller/ProjectControllerTests.java | 4 +-- .../src/test/resources/application.properties | 6 ++--- .../controller/AuthSourceControllerTests.java | 8 +++--- .../BaseDisplayControllerTests.java | 4 +-- .../OrganizationControllerTests.java | 26 +++++++++---------- .../OrganizationProjectControllerTests.java | 10 +++---- .../OrganizationUserRoleControllerTests.java | 10 +++---- .../SystemOrganizationControllerTests.java | 10 +++---- .../SystemParameterControllerTests.java | 8 +++--- .../SystemProjectControllerTests.java | 10 +++---- .../SystemVersionControllerTests.java | 4 +-- .../TestResourcePoolControllerTests.java | 20 +++++++------- .../system/utils/user/UserRequestUtils.java | 8 +++--- .../src/test/resources/application.properties | 6 ++--- .../controller/TestPlanControllerTests.java | 4 +-- .../src/test/resources/application.properties | 6 ++--- 21 files changed, 86 insertions(+), 86 deletions(-) diff --git a/backend/services/api-test/src/test/resources/application.properties b/backend/services/api-test/src/test/resources/application.properties index bf760f3a1b..d41f98f511 100644 --- a/backend/services/api-test/src/test/resources/application.properties +++ b/backend/services/api-test/src/test/resources/application.properties @@ -78,6 +78,6 @@ minio.endpoint=http://${embedded.minio.host}:${embedded.minio.port} minio.access-key=${embedded.minio.accessKey} minio.secret-key=${embedded.minio.secretKey} -logging.level.org.springframework.jdbc.core=trace -logging.level.io.metersphere.sdk.mapper=debug -logging.level.io.metersphere.project.mapper=debug \ No newline at end of file +logging.level.org.springframework.jdbc.core=info +logging.level.io.metersphere.sdk.mapper=info +logging.level.io.metersphere.project.mapper=info \ No newline at end of file diff --git a/backend/services/bug-management/src/test/java/io/metersphere/bug/controller/BugControllerTest.java b/backend/services/bug-management/src/test/java/io/metersphere/bug/controller/BugControllerTest.java index 927eef12b7..e96c91a638 100644 --- a/backend/services/bug-management/src/test/java/io/metersphere/bug/controller/BugControllerTest.java +++ b/backend/services/bug-management/src/test/java/io/metersphere/bug/controller/BugControllerTest.java @@ -18,7 +18,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import java.util.UUID; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -79,7 +79,7 @@ public class BugControllerTest { .andExpect(content().contentType(MediaType.APPLICATION_JSON)) // 检查数据 .andExpect(jsonPath("$.data.title").value("test")) - .andDo(print()); + ; // 缺陷已存在校验 mockMvc.perform( @@ -94,7 +94,7 @@ public class BugControllerTest { .andExpect(content().contentType(MediaType.APPLICATION_JSON)) // 检查业务状态码 .andExpect(jsonPath("$.code").value(108001)) - .andDo(print()); + ; } @Test diff --git a/backend/services/bug-management/src/test/resources/application.properties b/backend/services/bug-management/src/test/resources/application.properties index e1f1bfeb5f..7ec051882b 100644 --- a/backend/services/bug-management/src/test/resources/application.properties +++ b/backend/services/bug-management/src/test/resources/application.properties @@ -78,6 +78,6 @@ minio.endpoint=http://${embedded.minio.host}:${embedded.minio.port} minio.access-key=${embedded.minio.accessKey} minio.secret-key=${embedded.minio.secretKey} -logging.level.org.springframework.jdbc.core=debug -logging.level.io.metersphere.sdk.mapper=debug -logging.level.io.metersphere.system.mapper=debug +logging.level.org.springframework.jdbc.core=info +logging.level.io.metersphere.sdk.mapper=info +logging.level.io.metersphere.system.mapper=info diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java index af7dc52f0e..462987dae0 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java @@ -16,7 +16,7 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -65,7 +65,7 @@ public class CaseReviewControllerTests { .content(JSON.toJSONString(caseReview)) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andDo(print()); + .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @Test diff --git a/backend/services/case-management/src/test/resources/application.properties b/backend/services/case-management/src/test/resources/application.properties index 2c87dcbeac..967cf2b3e4 100644 --- a/backend/services/case-management/src/test/resources/application.properties +++ b/backend/services/case-management/src/test/resources/application.properties @@ -78,6 +78,6 @@ minio.endpoint=http://${embedded.minio.host}:${embedded.minio.port} minio.access-key=${embedded.minio.accessKey} minio.secret-key=${embedded.minio.secretKey} -logging.level.org.springframework.jdbc.core=trace -logging.level.io.metersphere.sdk.mapper=debug -logging.level.io.metersphere.functional.mapper=debug \ No newline at end of file +logging.level.org.springframework.jdbc.core=info +logging.level.io.metersphere.sdk.mapper=info +logging.level.io.metersphere.functional.mapper=info \ No newline at end of file diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectControllerTests.java index b5506342de..f601e7cc30 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectControllerTests.java @@ -79,7 +79,7 @@ public class ProjectControllerTests { // .contentType(MediaType.APPLICATION_JSON)) // .andExpect(status().isOk()) // .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - // .andDo(print()); + // ; // } // // @Test @@ -91,7 +91,7 @@ public class ProjectControllerTests { // .andExpect(status().isOk()) // .andExpect(content().contentType(MediaType.APPLICATION_JSON)) // // .andExpect(jsonPath("$.person.name").value("Jason")) - // .andDo(print()); + // ; // } } diff --git a/backend/services/project-management/src/test/resources/application.properties b/backend/services/project-management/src/test/resources/application.properties index 056515cdc7..6bec17e5bb 100644 --- a/backend/services/project-management/src/test/resources/application.properties +++ b/backend/services/project-management/src/test/resources/application.properties @@ -78,6 +78,6 @@ minio.endpoint=http://${embedded.minio.host}:${embedded.minio.port} minio.access-key=${embedded.minio.accessKey} minio.secret-key=${embedded.minio.secretKey} -logging.level.org.springframework.jdbc.core=trace -logging.level.io.metersphere.sdk.mapper=debug -logging.level.io.metersphere.project.mapper=debug \ No newline at end of file +logging.level.org.springframework.jdbc.core=info +logging.level.io.metersphere.sdk.mapper=info +logging.level.io.metersphere.project.mapper=info \ No newline at end of file diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/AuthSourceControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/AuthSourceControllerTests.java index 183b66f8db..dc3e3d998a 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/AuthSourceControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/AuthSourceControllerTests.java @@ -33,7 +33,7 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.List; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -165,7 +165,7 @@ public class AuthSourceControllerTests extends BaseTest { .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andDo(print()) + .andReturn(); } @@ -173,7 +173,7 @@ public class AuthSourceControllerTests extends BaseTest { return mockMvc.perform(MockMvcRequestBuilders.get(url) .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken)) - .andExpect(status().isOk()).andDo(print()).andReturn(); + .andExpect(status().isOk()).andReturn(); } private List getAuthSourceList() throws Exception { @@ -194,7 +194,7 @@ public class AuthSourceControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/BaseDisplayControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/BaseDisplayControllerTests.java index 39199a4486..b384c62cba 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/BaseDisplayControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/BaseDisplayControllerTests.java @@ -20,7 +20,7 @@ import org.springframework.test.context.jdbc.SqlConfig; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + @SpringBootTest @AutoConfigureMockMvc @@ -123,6 +123,6 @@ public class BaseDisplayControllerTests extends BaseTest { return mockMvc.perform(MockMvcRequestBuilders.get(url) .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken)) - .andDo(print()).andReturn(); + .andReturn(); } } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationControllerTests.java index f6f9f4818a..bec04109f6 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationControllerTests.java @@ -31,7 +31,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -321,7 +321,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -340,7 +340,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -356,7 +356,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is5xxServerError()).andDo(print()) + .andExpect(status().is5xxServerError()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } @@ -368,7 +368,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -387,7 +387,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -409,7 +409,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is5xxServerError()).andDo(print()) + .andExpect(status().is5xxServerError()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } @@ -422,7 +422,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -441,7 +441,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -457,7 +457,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is5xxServerError()).andDo(print()) + .andExpect(status().is5xxServerError()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } @@ -546,7 +546,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -556,7 +556,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -566,7 +566,7 @@ public class OrganizationControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(organizationRequest)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java index 8cb8995741..22b9ad98b9 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java @@ -42,7 +42,7 @@ import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -86,7 +86,7 @@ public class OrganizationProjectControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -96,7 +96,7 @@ public class OrganizationProjectControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } @@ -105,7 +105,7 @@ public class OrganizationProjectControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } private void responseGet(String url, ResultMatcher resultMatcher) throws Exception { @@ -113,7 +113,7 @@ public class OrganizationProjectControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java index 218ccbc839..b1d3ce142e 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java @@ -38,7 +38,7 @@ import java.util.stream.Collectors; import static io.metersphere.sdk.controller.handler.result.CommonResultCode.INTERNAL_USER_ROLE_PERMISSION; import static io.metersphere.system.controller.result.SystemResultCode.NO_ORG_USER_ROLE_PERMISSION; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @SpringBootTest @@ -414,7 +414,7 @@ public class OrganizationUserRoleControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -424,7 +424,7 @@ public class OrganizationUserRoleControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); } @@ -434,7 +434,7 @@ public class OrganizationUserRoleControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -443,7 +443,7 @@ public class OrganizationUserRoleControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemOrganizationControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemOrganizationControllerTests.java index 96d6a5fe60..10c6524ae4 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemOrganizationControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemOrganizationControllerTests.java @@ -29,7 +29,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import java.nio.charset.StandardCharsets; import java.util.*; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -421,7 +421,7 @@ public class SystemOrganizationControllerTests extends BaseTest{ .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -431,7 +431,7 @@ public class SystemOrganizationControllerTests extends BaseTest{ .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); } @@ -441,7 +441,7 @@ public class SystemOrganizationControllerTests extends BaseTest{ .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -450,7 +450,7 @@ public class SystemOrganizationControllerTests extends BaseTest{ .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemParameterControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemParameterControllerTests.java index 9547749bc3..0ed99aba5c 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemParameterControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemParameterControllerTests.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -165,7 +165,7 @@ public class SystemParameterControllerTests extends BaseTest { .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andDo(print()) + .andReturn(); } @@ -173,7 +173,7 @@ public class SystemParameterControllerTests extends BaseTest { return mockMvc.perform(MockMvcRequestBuilders.get(url) .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken)) - .andExpect(status().isOk()).andDo(print()).andReturn(); + .andExpect(status().isOk()).andReturn(); } private void requestPost(String url, Object param, ResultMatcher resultMatcher) throws Exception { @@ -182,7 +182,7 @@ public class SystemParameterControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java index 7e11e35943..6d7a3c7712 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemProjectControllerTests.java @@ -40,7 +40,7 @@ import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -78,7 +78,7 @@ public class SystemProjectControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -88,7 +88,7 @@ public class SystemProjectControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } @@ -97,7 +97,7 @@ public class SystemProjectControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } private void responseGet(String url, ResultMatcher resultMatcher) throws Exception { @@ -105,7 +105,7 @@ public class SystemProjectControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTests.java index d7cd4c1576..01d692544c 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/SystemVersionControllerTests.java @@ -13,7 +13,7 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @@ -30,7 +30,7 @@ public class SystemVersionControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()); + .andExpect(status().isOk()); } } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTests.java index 5bf13c4048..b0b526bcc1 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/TestResourcePoolControllerTests.java @@ -36,7 +36,7 @@ import java.util.List; import static org.mockserver.model.HttpRequest.request; import static org.mockserver.model.HttpResponse.response; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -218,7 +218,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(testResourcePoolRequest)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(ERROR_REQUEST_MATCHER).andDo(print()) + .andExpect(ERROR_REQUEST_MATCHER) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -261,7 +261,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(request)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String sortData = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8); ResultHolder sortHolder = JSON.parseObject(sortData, ResultHolder.class); @@ -285,7 +285,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(request)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -299,7 +299,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -339,7 +339,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -385,7 +385,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(request)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class); @@ -406,7 +406,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(request)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(ERROR_REQUEST_MATCHER).andDo(print()) + .andExpect(ERROR_REQUEST_MATCHER) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -605,7 +605,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(request)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); String sortData = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8); ResultHolder sortHolder = JSON.parseObject(sortData, ResultHolder.class); @@ -624,7 +624,7 @@ class TestResourcePoolControllerTests extends BaseTest { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(testResourcePoolRequest)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/utils/user/UserRequestUtils.java b/backend/services/system-setting/src/test/java/io/metersphere/system/utils/user/UserRequestUtils.java index e07b1d3cb4..73d6c13f5a 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/utils/user/UserRequestUtils.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/utils/user/UserRequestUtils.java @@ -13,7 +13,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import java.nio.charset.StandardCharsets; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -66,7 +66,7 @@ public class UserRequestUtils { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(resultMatcher).andDo(print()) + .andExpect(resultMatcher) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } @@ -95,7 +95,7 @@ public class UserRequestUtils { .header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); } @@ -105,7 +105,7 @@ public class UserRequestUtils { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(param)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andDo(print()) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); } diff --git a/backend/services/system-setting/src/test/resources/application.properties b/backend/services/system-setting/src/test/resources/application.properties index 559148656a..6561b0ec53 100644 --- a/backend/services/system-setting/src/test/resources/application.properties +++ b/backend/services/system-setting/src/test/resources/application.properties @@ -82,6 +82,6 @@ minio.endpoint=http://${embedded.minio.host}:${embedded.minio.port} minio.access-key=${embedded.minio.accessKey} minio.secret-key=${embedded.minio.secretKey} -logging.level.org.springframework.jdbc.core=debug -logging.level.io.metersphere.sdk.mapper=debug -logging.level.io.metersphere.system.mapper=debug \ No newline at end of file +logging.level.org.springframework.jdbc.core=info +logging.level.io.metersphere.sdk.mapper=info +logging.level.io.metersphere.system.mapper=info \ No newline at end of file diff --git a/backend/services/test-plan/src/test/java/io/metersphere/plan/controller/TestPlanControllerTests.java b/backend/services/test-plan/src/test/java/io/metersphere/plan/controller/TestPlanControllerTests.java index 8dd793dbfc..3dade47db2 100644 --- a/backend/services/test-plan/src/test/java/io/metersphere/plan/controller/TestPlanControllerTests.java +++ b/backend/services/test-plan/src/test/java/io/metersphere/plan/controller/TestPlanControllerTests.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -264,7 +264,7 @@ public class TestPlanControllerTests { .header(SessionConstants.CSRF_TOKEN, csrfToken) .content(JSON.toJSONString(testPlan)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is5xxServerError()).andDo(print()); + .andExpect(status().is5xxServerError()); //测试parentId和id相同 testPlan = this.getSimpleTestPlan(); diff --git a/backend/services/test-plan/src/test/resources/application.properties b/backend/services/test-plan/src/test/resources/application.properties index 70f1c1c4c8..478be602ab 100644 --- a/backend/services/test-plan/src/test/resources/application.properties +++ b/backend/services/test-plan/src/test/resources/application.properties @@ -78,6 +78,6 @@ minio.endpoint=http://${embedded.minio.host}:${embedded.minio.port} minio.access-key=${embedded.minio.accessKey} minio.secret-key=${embedded.minio.secretKey} -logging.level.org.springframework.jdbc.core=debug -logging.level.io.metersphere.sdk.mapper=debug -logging.level.io.metersphere.system.mapper=debug \ No newline at end of file +logging.level.org.springframework.jdbc.core=info +logging.level.io.metersphere.sdk.mapper=info +logging.level.io.metersphere.system.mapper=info \ No newline at end of file