Skip to content

Instantly share code, notes, and snippets.

@GHGHGHKO
Created February 23, 2023 12:05
Show Gist options
  • Select an option

  • Save GHGHGHKO/ba18fff85addea0260b82e683552c8df to your computer and use it in GitHub Desktop.

Select an option

Save GHGHGHKO/ba18fff85addea0260b82e683552c8df to your computer and use it in GitHub Desktop.
UserControllerTest success get all users
@Test
fun `모든 유저 정보를 가져온다`() {
mockMvc.get("/users/v1") {
contentType = MediaType.APPLICATION_JSON
header(X_AUTH_TOKEN, token)
}
.andDo { print() }
.andExpect { status { isOk() } }
.andExpect { jsonPath("$.success") { value(true) } }
.andExpect { jsonPath("$.code") { value(0) } }
.andExpect { jsonPath("$.message") { exists() } }
.andExpect { jsonPath("$.results") { isArray() } }
.andExpect { jsonPath("$.results.length()") { value(6) } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment