|
|
|
@ -133,8 +133,6 @@ class DemoApplicationTests { |
|
|
|
|
.param("activeScore", "15") |
|
|
|
|
.param("title", "666") |
|
|
|
|
.param("content", "fuckfuckfuckfuckfuck") |
|
|
|
|
.param("username", "panqihua") |
|
|
|
|
.param("token", "b6a518fffa3ffa607e756324474e9484") |
|
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -145,28 +143,27 @@ class DemoApplicationTests { |
|
|
|
|
.param("complain", "panqihua") |
|
|
|
|
.param("title", "666") |
|
|
|
|
.param("content", "fuckfuckfuckfuckfuck") |
|
|
|
|
.param("token", "b6a518fffa3ffa607e756324474e9484") |
|
|
|
|
.param("username", "panqihua") |
|
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//测试发送动态
|
|
|
|
|
@Test |
|
|
|
|
void testTopic() throws Exception { |
|
|
|
|
mockMvc.perform(MockMvcRequestBuilders.post("/forum/sendTopic") |
|
|
|
|
.param("title", "666") |
|
|
|
|
for (int i = 0; i < 20; i++) { |
|
|
|
|
MockHttpServletRequestBuilder builder = MockMvcRequestBuilders.post("/forum/sendTopic") |
|
|
|
|
.param("title", "title" + i) |
|
|
|
|
.param("content", "fuckfuckfuckfuckfuck") |
|
|
|
|
.param("token", "b6a518fffa3ffa607e756324474e9484") |
|
|
|
|
.param("username", "panqihua") |
|
|
|
|
.param("forumType", "topic"); |
|
|
|
|
mockMvc.perform(addToken(builder) |
|
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//测试查询帖子
|
|
|
|
|
@Test |
|
|
|
|
void queryForum() throws Exception { |
|
|
|
|
mockMvc.perform(MockMvcRequestBuilders.get("/api/forum/posts") |
|
|
|
|
.param("status", Forum.ForumStatus.ok.name()) |
|
|
|
|
.param("username", "panqihua") |
|
|
|
|
.param("currentPage", "1") |
|
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
|
} |
|
|
|
@ -201,7 +198,6 @@ class DemoApplicationTests { |
|
|
|
|
void queryVisitor() throws Exception { |
|
|
|
|
mockMvc.perform(MockMvcRequestBuilders.get("/visitor/reservation") |
|
|
|
|
.param("username", "panqihua") |
|
|
|
|
.param("token", "e3c8ed5a74841556c57de6e17b166f68") |
|
|
|
|
.param("startDate", "2020/04/18") |
|
|
|
|
.param("endDate", "2020/04/19")) |
|
|
|
|
.andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
@ -255,4 +251,5 @@ class DemoApplicationTests { |
|
|
|
|
visitorDao.save(visitorForm); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|