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 Dec 26, 2023
1 parent 86e5717 commit 2f4b5cd
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package com.twtw.backend.domain.friend.controller;

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

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
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;

import com.twtw.backend.domain.friend.dto.request.FriendRequest;
import com.twtw.backend.domain.friend.dto.request.FriendUpdateRequest;
import com.twtw.backend.domain.friend.dto.response.FriendResponse;
import com.twtw.backend.domain.friend.entity.FriendStatus;
import com.twtw.backend.domain.friend.service.FriendService;
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;
Expand All @@ -16,18 +30,6 @@
import java.util.List;
import java.util.UUID;

import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentRequest;
import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentResponse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
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("FriendController의")
@WebMvcTest(FriendController.class)
class FriendControllerTest extends RestDocsTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
package com.twtw.backend.domain.group.controller;

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

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*;
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;

import com.twtw.backend.domain.group.dto.request.*;
import com.twtw.backend.domain.group.dto.response.GroupInfoResponse;
import com.twtw.backend.domain.group.dto.response.ShareInfoResponse;
import com.twtw.backend.domain.group.dto.response.SimpleGroupInfoResponse;
import com.twtw.backend.domain.group.service.GroupService;
import com.twtw.backend.domain.member.dto.response.MemberResponse;
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;
Expand All @@ -18,17 +31,6 @@
import java.util.List;
import java.util.UUID;

import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentRequest;
import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentResponse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*;
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("GroupController의")
@WebMvcTest(GroupController.class)
class GroupControllerTest extends RestDocsTest {
Expand All @@ -45,8 +47,10 @@ void getGroupById() throws Exception {
"HDJ",
"GROUP-IMAGE",
List.of(
new MemberResponse(UUID.randomUUID(), "DEAN", "http://hojiniSelfie"),
new MemberResponse(UUID.randomUUID(), "ZION-T", "http://hojiniSelfie")));
new MemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie"),
new MemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie")));
given(groupService.getGroupById(UUID.fromString("550e8400-e29b-41d4-a716-446655440000")))
.willReturn(expected);

Expand Down Expand Up @@ -74,8 +78,10 @@ void makeGroup() throws Exception {
"HDJ",
"GROUP-IMAGE",
List.of(
new MemberResponse(UUID.randomUUID(), "DEAN", "http://hojiniSelfie"),
new MemberResponse(UUID.randomUUID(), "ZION-T", "http://hojiniSelfie")));
new MemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie"),
new MemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie")));
given(groupService.makeGroup(any())).willReturn(expected);

final ResultActions perform =
Expand Down Expand Up @@ -133,8 +139,10 @@ void inviteGroup() throws Exception {
"홍담진",
"http://someUrlToS3",
List.of(
new MemberResponse(UUID.randomUUID(), "DEAN", "http://hojiniSelfie"),
new MemberResponse(UUID.randomUUID(), "ZION-T", "http://hojiniSelfie")));
new MemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie"),
new MemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie")));
given(groupService.inviteGroup(any())).willReturn(expected);

// when
Expand Down Expand Up @@ -294,17 +302,21 @@ void getMyGroups() throws Exception {
"BLACK_PINK",
"I_LOVE_YOU_LOSE",
List.of(
new MemberResponse(UUID.randomUUID(), "LISA", "http://hojiniSelfieWow"),
new MemberResponse(UUID.randomUUID(), "제니", "http://hojiniSelfieAwesome")));
new MemberResponse(
UUID.randomUUID(), "LISA", "http://hojiniSelfieWow"),
new MemberResponse(
UUID.randomUUID(), "제니", "http://hojiniSelfieAwesome")));
GroupInfoResponse response2 =
new GroupInfoResponse(
UUID.randomUUID(),
leaderId,
"LE_SSERAFIM",
"I_LOVE_YOU_채원",
List.of(
new MemberResponse(UUID.randomUUID(), "카즈하", "http://hojiniSelfieGreat"),
new MemberResponse(UUID.randomUUID(), "사쿠라", "http://hojiniSelfieGoat")));
new MemberResponse(
UUID.randomUUID(), "카즈하", "http://hojiniSelfieGreat"),
new MemberResponse(
UUID.randomUUID(), "사쿠라", "http://hojiniSelfieGoat")));

responseList.add(response1);
responseList.add(response2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
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.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
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;

import com.twtw.backend.domain.member.dto.response.DuplicateNicknameResponse;
import com.twtw.backend.domain.member.dto.response.MemberResponse;
import com.twtw.backend.domain.member.dto.response.SearchMemberResponse;
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;
Expand All @@ -14,16 +26,6 @@

import java.util.UUID;

import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentRequest;
import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentResponse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
package com.twtw.backend.domain.plan.controller;

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

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*;
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;

import com.twtw.backend.domain.group.dto.response.GroupInfoResponse;
import com.twtw.backend.domain.member.dto.response.MemberResponse;
import com.twtw.backend.domain.place.entity.CategoryGroupCode;
Expand All @@ -13,6 +25,7 @@
import com.twtw.backend.domain.plan.dto.response.PlanResponse;
import com.twtw.backend.domain.plan.service.PlanService;
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;
Expand All @@ -25,17 +38,6 @@
import java.util.List;
import java.util.UUID;

import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentRequest;
import static com.twtw.backend.support.docs.ApiDocsUtils.getDocumentResponse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*;
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("PlanController의")
@WebMvcTest(PlanController.class)
class PlanControllerTest extends RestDocsTest {
Expand Down Expand Up @@ -154,10 +156,14 @@ void getPlanById() throws Exception {
"홍담진",
"http://someUrlToS3",
List.of(
new MemberResponse(UUID.randomUUID(), "카즈하", "http://HJ39FaceCamera"),
new MemberResponse(UUID.randomUUID(), "사쿠라", "http://HJ39FaceCam"))),
new MemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39FaceCamera"),
new MemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39FaceCam"))),
List.of(new MemberResponse(UUID.randomUUID(), "진호정", "http://HJ39Face")),
List.of(new MemberResponse(UUID.randomUUID(), "진정Ho", "http://HJ39Camera")));
List.of(
new MemberResponse(
UUID.randomUUID(), "진정Ho", "http://HJ39Camera")));
given(planService.getPlanById(any())).willReturn(expected);

// when
Expand Down Expand Up @@ -320,10 +326,19 @@ void getPlans() throws Exception {
"http://someUrlToS3",
List.of(
new MemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39GOAT"),
UUID.randomUUID(),
"카즈하",
"http://HJ39GOAT"),
new MemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39"))))
.members(List.of(new MemberResponse(UUID.randomUUID(), "진호정", "http://HoJin39")))
UUID.randomUUID(),
"사쿠라",
"http://HJ39"))))
.members(
List.of(
new MemberResponse(
UUID.randomUUID(),
"진호정",
"http://HoJin39")))
.build(),
PlanInfoResponse.builder()
.planId(UUID.randomUUID())
Expand All @@ -346,13 +361,19 @@ void getPlans() throws Exception {
"http://someUrlToS3",
List.of(
new MemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39"),
UUID.randomUUID(),
"카즈하",
"http://HJ39"),
new MemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39"))))
UUID.randomUUID(),
"사쿠라",
"http://HJ39"))))
.members(
List.of(
new MemberResponse(
UUID.randomUUID(), "JinHoJeong", "http://HJ39")))
UUID.randomUUID(),
"JinHoJeong",
"http://HJ39")))
.build());

given(planService.getPlans()).willReturn(expected);
Expand Down

0 comments on commit 2f4b5cd

Please sign in to comment.