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.

Revisions

  1. GHGHGHKO created this gist Feb 23, 2023.
    15 changes: 15 additions & 0 deletions UserControllerTest.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    @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) } }
    }