Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 6, 2023
1 parent 572e475 commit ca0ecb7
Showing 1 changed file with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
package com.twtw.backend.domain.member.controller;

import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentRequest;
import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentResponse;

import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import com.twtw.backend.domain.member.service.MemberService;
import com.twtw.backend.support.docs.RestDocsTest;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.ResultActions;

import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentRequest;
import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentResponse;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.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;

@DisplayName("MemberController의")
@WebMvcTest(MemberController.class)
public class MemberControllerTest extends RestDocsTest {
@MockBean private MemberService memberService;

@Test
@DisplayName("닉네임이 중복되었는가")
void duplicate() throws Exception{
void duplicate() throws Exception {
final ResultActions perform =
mockMvc.perform(
get("/member/duplicate/{name}","진주원")
get("/member/duplicate/{name}", "진주원")
.contentType(MediaType.APPLICATION_JSON)
.header(
"Authorization",
"Bearer wefa3fsdczf32.gaoiuergf92.gb5hsa2jgh")
);
"Bearer wefa3fsdczf32.gaoiuergf92.gb5hsa2jgh"));

// then
perform.andExpect(status().isOk());
// docs

perform.andDo(print())
.andDo(document("get duplicate nickname", getDocumentRequest(), getDocumentResponse()));
.andDo(
document(
"get duplicate nickname",
getDocumentRequest(),
getDocumentResponse()));
}
}

0 comments on commit ca0ecb7

Please sign in to comment.