From 2f4b5cd5f6d7f01738daebf6fb2ec15890e730f7 Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Tue, 26 Dec 2023 14:49:36 +0000 Subject: [PATCH] Google Java Format --- .../controller/FriendControllerTest.java | 26 ++++---- .../group/controller/GroupControllerTest.java | 54 +++++++++------- .../controller/MemberControllerTest.java | 22 ++++--- .../plan/controller/PlanControllerTest.java | 61 +++++++++++++------ 4 files changed, 100 insertions(+), 63 deletions(-) diff --git a/backend/src/test/java/com/twtw/backend/domain/friend/controller/FriendControllerTest.java b/backend/src/test/java/com/twtw/backend/domain/friend/controller/FriendControllerTest.java index f5e9b469..5a0fdf82 100644 --- a/backend/src/test/java/com/twtw/backend/domain/friend/controller/FriendControllerTest.java +++ b/backend/src/test/java/com/twtw/backend/domain/friend/controller/FriendControllerTest.java @@ -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; @@ -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 { diff --git a/backend/src/test/java/com/twtw/backend/domain/group/controller/GroupControllerTest.java b/backend/src/test/java/com/twtw/backend/domain/group/controller/GroupControllerTest.java index f79da15f..957b99c9 100644 --- a/backend/src/test/java/com/twtw/backend/domain/group/controller/GroupControllerTest.java +++ b/backend/src/test/java/com/twtw/backend/domain/group/controller/GroupControllerTest.java @@ -1,5 +1,17 @@ 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; @@ -7,6 +19,7 @@ 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; @@ -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 { @@ -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); @@ -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 = @@ -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 @@ -294,8 +302,10 @@ 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(), @@ -303,8 +313,10 @@ void getMyGroups() throws Exception { "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); diff --git a/backend/src/test/java/com/twtw/backend/domain/member/controller/MemberControllerTest.java b/backend/src/test/java/com/twtw/backend/domain/member/controller/MemberControllerTest.java index 9c8f1ef6..8f1b7def 100644 --- a/backend/src/test/java/com/twtw/backend/domain/member/controller/MemberControllerTest.java +++ b/backend/src/test/java/com/twtw/backend/domain/member/controller/MemberControllerTest.java @@ -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; @@ -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 { diff --git a/backend/src/test/java/com/twtw/backend/domain/plan/controller/PlanControllerTest.java b/backend/src/test/java/com/twtw/backend/domain/plan/controller/PlanControllerTest.java index 979fa80a..818716ec 100644 --- a/backend/src/test/java/com/twtw/backend/domain/plan/controller/PlanControllerTest.java +++ b/backend/src/test/java/com/twtw/backend/domain/plan/controller/PlanControllerTest.java @@ -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; @@ -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; @@ -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 { @@ -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 @@ -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()) @@ -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);