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