-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
module-presentation/src/test/java/com/depromeet/greeting/api/GreetingControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.depromeet.greeting.api; | ||
|
||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; | ||
|
||
import com.depromeet.config.ControllerTestConfig; | ||
import com.depromeet.config.mock.WithCustomMockMember; | ||
import com.depromeet.greeting.facade.GreetingFacade; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; | ||
import org.springframework.boot.test.mock.mockito.MockBean; | ||
|
||
@WebMvcTest(GreetingController.class) | ||
public class GreetingControllerTest extends ControllerTestConfig { | ||
@MockBean GreetingFacade greetingFacade; | ||
|
||
@Test | ||
@WithCustomMockMember | ||
public void 인삿말을_조회합니다() throws Exception { | ||
mockMvc.perform(get("/greeting")) | ||
.andExpect(status().isOk()) | ||
.andExpect(jsonPath("$.code").value("GREETING_1")) | ||
.andExpect(jsonPath("$.message").value("인삿말 조회에 성공하였습니다")); | ||
} | ||
} |