完善测试类

master
panqihua 5 years ago
parent b2582a99c1
commit 94a7b392e0
  1. 13
      src/test/java/com/community/pocket/DemoApplicationTests.java

@ -142,23 +142,26 @@ class DemoApplicationTests {
@Test
//测试添加活动贴
void testActive() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/forum/sendActive")
MockHttpServletRequestBuilder builder = MockMvcRequestBuilders.post("/forum/sendActive")
.param("activeStartTime", "2020/01/01")
.param("activeEndTime", "2020/01/02")
.param("activeScore", "15")
.param("title", "666")
.param("content", "fuckfuckfuckfuckfuck")
).andDo(MockMvcResultHandlers.print()).andReturn();
.param("registrationDeadline", "2020/01/03")
.param("forumType", "active");
mockMvc.perform(addToken(builder)).andDo(MockMvcResultHandlers.print()).andReturn();
}
@Test
//测试添加投诉贴
void testComplain() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/forum/sendComplain")
MockHttpServletRequestBuilder builder = MockMvcRequestBuilders.post("/forum/sendComplain")
.param("complain", "panqihua")
.param("title", "666")
.param("content", "fuckfuckfuckfuckfuck")
).andDo(MockMvcResultHandlers.print()).andReturn();
.param("content", "pan9412")
.param("forumType", "complan");
mockMvc.perform(addToken(builder)).andDo(MockMvcResultHandlers.print()).andReturn();
}
//测试发送动态

Loading…
Cancel
Save