Created
February 23, 2023 13:06
-
-
Save GHGHGHKO/15f6bd4868e360d04b36458b59175624 to your computer and use it in GitHub Desktop.
UserControllerTest accessDenied test code
This file contains hidden or 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
| @Test | |
| fun `권한 문제로 유저 정보를 가져오지 못한다`() { | |
| val signInRequestDto = SignInRequestDto( | |
| email = ID + 0 + EMAIL, | |
| password = PASSWORD | |
| ) | |
| token = signService.signIn(signInRequestDto).token | |
| mockMvc.get("/users/v1") { | |
| contentType = MediaType.APPLICATION_JSON | |
| header(X_AUTH_TOKEN, token) | |
| } | |
| .andDo { print() } | |
| .andExpect { status { is4xxClientError() } } | |
| .andExpect { jsonPath("$.success") { value(false) } } | |
| .andExpect { jsonPath("$.code") { value(-1003) } } | |
| .andExpect { jsonPath("$.message") { exists() } } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment