|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.community.pocket; |
|
|
|
package com.community.pocket; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.community.pocket.entity.po.Forum; |
|
|
|
import com.community.pocket.entity.po.android.Garbage; |
|
|
|
import com.community.pocket.entity.po.android.Garbage; |
|
|
|
import com.community.pocket.entity.po.android.GarbageWastePrice; |
|
|
|
import com.community.pocket.entity.po.android.GarbageWastePrice; |
|
|
|
import com.community.pocket.entity.vo.android.GarbageCateGory; |
|
|
|
import com.community.pocket.entity.vo.android.GarbageCateGory; |
|
|
@ -143,14 +144,16 @@ class DemoApplicationTests { |
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//测试查询帖子
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
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("currentPage", "1") |
|
|
|
.param("currentPage", "1") |
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
).andDo(MockMvcResultHandlers.print()).andReturn(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//测试登陆
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void login() throws Exception { |
|
|
|
void login() throws Exception { |
|
|
|
mockMvc.perform(MockMvcRequestBuilders.post("/login") |
|
|
|
mockMvc.perform(MockMvcRequestBuilders.post("/login") |
|
|
|