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