build: 去掉不必要的控制台输出

This commit is contained in:
CaptainB 2023-08-16 14:45:04 +08:00 committed by 刘瑞斌
parent 3002e7ca36
commit ca40ac7c60
21 changed files with 86 additions and 86 deletions

View File

@ -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
logging.level.org.springframework.jdbc.core=info
logging.level.io.metersphere.sdk.mapper=info
logging.level.io.metersphere.project.mapper=info

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
logging.level.org.springframework.jdbc.core=info
logging.level.io.metersphere.sdk.mapper=info
logging.level.io.metersphere.functional.mapper=info

View File

@ -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());
// ;
// }
}

View File

@ -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
logging.level.org.springframework.jdbc.core=info
logging.level.io.metersphere.sdk.mapper=info
logging.level.io.metersphere.project.mapper=info

View File

@ -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<AuthSourceRequest> 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));
}

View File

@ -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();
}
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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));
}
}

View File

@ -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();
}

View File

@ -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());
}
}

View File

@ -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));
}

View File

@ -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();
}

View File

@ -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
logging.level.org.springframework.jdbc.core=info
logging.level.io.metersphere.sdk.mapper=info
logging.level.io.metersphere.system.mapper=info

View File

@ -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();

View File

@ -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