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 Jan 19, 2024
1 parent 521c458 commit 9c68e0b
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
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.GroupMemberResponse;
import com.twtw.backend.domain.group.service.GroupService;
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,17 +29,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 @@ -46,7 +48,10 @@ void getGroupById() throws Exception {
new GroupMemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie", true),
new GroupMemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie", false)));
UUID.randomUUID(),
"ZION-T",
"http://hojiniSelfie",
false)));
given(groupService.getGroupById(UUID.fromString("550e8400-e29b-41d4-a716-446655440000")))
.willReturn(expected);

Expand Down Expand Up @@ -77,7 +82,10 @@ void makeGroup() throws Exception {
new GroupMemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie", true),
new GroupMemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie", false)));
UUID.randomUUID(),
"ZION-T",
"http://hojiniSelfie",
false)));
given(groupService.makeGroup(any())).willReturn(expected);

final ResultActions perform =
Expand Down Expand Up @@ -137,7 +145,10 @@ void inviteGroup() throws Exception {
new GroupMemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie", true),
new GroupMemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie", false)));
UUID.randomUUID(),
"ZION-T",
"http://hojiniSelfie",
false)));
given(groupService.inviteGroup(any())).willReturn(expected);

// when
Expand Down Expand Up @@ -260,7 +271,10 @@ void getMyGroups() throws Exception {
new GroupMemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie", true),
new GroupMemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie", false)));
UUID.randomUUID(),
"ZION-T",
"http://hojiniSelfie",
false)));
GroupInfoResponse response2 =
new GroupInfoResponse(
UUID.randomUUID(),
Expand All @@ -271,7 +285,10 @@ void getMyGroups() throws Exception {
new GroupMemberResponse(
UUID.randomUUID(), "DEAN", "http://hojiniSelfie", true),
new GroupMemberResponse(
UUID.randomUUID(), "ZION-T", "http://hojiniSelfie", false)));
UUID.randomUUID(),
"ZION-T",
"http://hojiniSelfie",
false)));

responseList.add(response1);
responseList.add(response2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.twtw.backend.domain.group.dto.request.JoinGroupRequest;
import com.twtw.backend.domain.group.dto.request.MakeGroupRequest;
import com.twtw.backend.domain.group.dto.response.GroupInfoResponse;
import com.twtw.backend.domain.group.dto.response.GroupMemberResponse;
import com.twtw.backend.domain.group.entity.Group;
import com.twtw.backend.domain.group.entity.GroupMember;
import com.twtw.backend.domain.group.repository.GroupMemberRepository;
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.group.dto.response.GroupMemberResponse;
import com.twtw.backend.domain.member.dto.response.MemberResponse;
Expand All @@ -14,6 +26,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 @@ -26,17 +39,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 @@ -156,9 +158,15 @@ void getPlanById() throws Exception {
"http://someUrlToS3",
List.of(
new GroupMemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39FaceCamera", true),
UUID.randomUUID(),
"카즈하",
"http://HJ39FaceCamera",
true),
new GroupMemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39FaceCam", false))),
UUID.randomUUID(),
"사쿠라",
"http://HJ39FaceCam",
false))),
List.of(new MemberResponse(UUID.randomUUID(), "진호정", "http://HJ39Face")),
List.of(
new MemberResponse(
Expand Down Expand Up @@ -325,9 +333,15 @@ void getPlans() throws Exception {
"http://someUrlToS3",
List.of(
new GroupMemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39FaceCamera", true),
UUID.randomUUID(),
"카즈하",
"http://HJ39FaceCamera",
true),
new GroupMemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39FaceCam", false))))
UUID.randomUUID(),
"사쿠라",
"http://HJ39FaceCam",
false))))
.members(
List.of(
new MemberResponse(
Expand Down Expand Up @@ -356,9 +370,15 @@ void getPlans() throws Exception {
"http://someUrlToS3",
List.of(
new GroupMemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39FaceCamera", true),
UUID.randomUUID(),
"카즈하",
"http://HJ39FaceCamera",
true),
new GroupMemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39FaceCam", false))))
UUID.randomUUID(),
"사쿠라",
"http://HJ39FaceCam",
false))))
.members(
List.of(
new MemberResponse(
Expand Down Expand Up @@ -484,9 +504,15 @@ void getPlansByGroupId() throws Exception {
"http://someUrlToS3",
List.of(
new GroupMemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39FaceCamera", true),
UUID.randomUUID(),
"카즈하",
"http://HJ39FaceCamera",
true),
new GroupMemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39FaceCam", false))))
UUID.randomUUID(),
"사쿠라",
"http://HJ39FaceCam",
false))))
.members(
List.of(
new MemberResponse(
Expand Down Expand Up @@ -515,9 +541,15 @@ void getPlansByGroupId() throws Exception {
"http://someUrlToS3",
List.of(
new GroupMemberResponse(
UUID.randomUUID(), "카즈하", "http://HJ39FaceCamera", true),
UUID.randomUUID(),
"카즈하",
"http://HJ39FaceCamera",
true),
new GroupMemberResponse(
UUID.randomUUID(), "사쿠라", "http://HJ39FaceCam", false))))
UUID.randomUUID(),
"사쿠라",
"http://HJ39FaceCam",
false))))
.members(
List.of(
new MemberResponse(
Expand Down

0 comments on commit 9c68e0b

Please sign in to comment.