From 9c6ab68389dad5b195da47733250588398c3e2ee Mon Sep 17 00:00:00 2001 From: Minsu Kim Date: Wed, 7 Aug 2024 11:07:18 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20member=20api=20=EC=9D=91=EB=8B=B5?= =?UTF-8?q?=20=EB=B3=B4=EC=99=84=20(#208)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/test/java/develup/api/MemberApiTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/test/java/develup/api/MemberApiTest.java b/backend/src/test/java/develup/api/MemberApiTest.java index 0e21fae7..1d7be254 100644 --- a/backend/src/test/java/develup/api/MemberApiTest.java +++ b/backend/src/test/java/develup/api/MemberApiTest.java @@ -1,9 +1,11 @@ package develup.api; +import static org.hamcrest.Matchers.equalTo; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyLong; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import develup.application.member.MemberResponse; @@ -43,6 +45,10 @@ void getMyInfo() throws Exception { .cookie(new Cookie("token", "mock_token")) ) .andDo(print()) - .andExpect(status().isOk()); + .andExpect(status().isOk()) + .andExpect(jsonPath("$.data.id", equalTo(1))) + .andExpect(jsonPath("$.data.email", equalTo("example@gmail.com"))) + .andExpect(jsonPath("$.data.name", equalTo("example"))) + .andExpect(jsonPath("$.data.imageUrl", equalTo("https://example.com/image.png"))); } }