Skip to content

Commit bc91638

Browse files
authored
[FEAT] 모임 V2 테스트 리팩토링
[FEAT] 모임 V2 테스트 리팩토링
2 parents 84be549 + 990b15e commit bc91638

File tree

8 files changed

+205
-93
lines changed

8 files changed

+205
-93
lines changed

src/main/java/team/wego/wegobackend/group/v2/application/dto/common/GroupImageVariantItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public static GroupImageVariantItem from(GroupImageV2Variant variant) {
1818
return new GroupImageVariantItem(
1919
variant.getId(),
2020
type,
21-
type.getWidth(),
22-
type.getHeight(),
21+
type.width(),
22+
type.height(),
2323
variant.getFormat(),
2424
variant.getImageUrl()
2525
);

src/main/java/team/wego/wegobackend/group/v2/infrastructure/redis/PreUploadedGroupImageRedisConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ public RedisTemplate<String, PreUploadedGroupImage> preUploadedGroupImageRedisTe
3636
template.afterPropertiesSet();
3737
return template;
3838
}
39-
}
39+
}
40+

src/main/java/team/wego/wegobackend/group/v2/presentation/GroupImageV2Controller.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.List;
44
import lombok.RequiredArgsConstructor;
55
import org.springframework.http.HttpStatus;
6+
import org.springframework.http.MediaType;
67
import org.springframework.http.ResponseEntity;
78
import org.springframework.security.core.annotation.AuthenticationPrincipal;
89
import org.springframework.web.bind.annotation.PostMapping;
@@ -23,7 +24,7 @@ public class GroupImageV2Controller {
2324
private final GroupImageV2PreUploadService preUploadService;
2425

2526

26-
@PostMapping("/upload")
27+
@PostMapping(value="/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
2728
public ResponseEntity<ApiResponse<PreUploadGroupImageV2Response>> uploadImages(
2829
@AuthenticationPrincipal CustomUserDetails userDetails,
2930
@RequestParam("images") List<MultipartFile> images

src/test/http/group/v2/V2-group-cancel.http

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 회원가입(HOST)
1+
### 0. 회원가입(HOST2)
22
POST http://localhost:8080/api/v1/auth/signup
33
Content-Type: application/json
44

@@ -13,7 +13,8 @@ Content-Type: application/json
1313
client.global.set("host2UserId", response.body.data.userId);
1414
%}
1515

16-
### 로그인(HOST)
16+
17+
### 0-1. 로그인(HOST2) - accessToken 발급
1718
POST http://localhost:8080/api/v1/auth/login
1819
Content-Type: application/json
1920

@@ -26,8 +27,9 @@ Content-Type: application/json
2627
client.global.set("host2AccessToken", response.body.data.accessToken);
2728
%}
2829

29-
### 2-1. 모임 이미지 선 업로드 (png / jpg 2장)
30-
POST http://localhost:8080/api/v1/groups/images/upload
30+
31+
### 1-1. 모임 V2 이미지 선 업로드 (png / jpg 2장)
32+
POST http://localhost:8080/api/v2/groups/images/upload
3133
Content-Type: multipart/form-data; boundary=boundary
3234
Authorization: Bearer {{host2AccessToken}}
3335

@@ -53,7 +55,8 @@ Content-Type: image/jpeg
5355
client.global.set("c_img1_thumb", images[1].imageUrl100x100);
5456
%}
5557

56-
### 2-2. 모임 생성 (취소 테스트용 모임)
58+
59+
### 1-2. 모임 V2 생성 (취소 테스트용 모임 / 정상 케이스: 기준일 2026-12-19 이후)
5760
POST http://localhost:8080/api/v2/groups/create
5861
Content-Type: application/json
5962
Authorization: Bearer {{host2AccessToken}}
@@ -62,8 +65,8 @@ Authorization: Bearer {{host2AccessToken}}
6265
"title": "참여 취소 테스트용 자바 스터디",
6366
"location": "서울 서초구",
6467
"locationDetail": "교대역 1번 출구 근처 카페",
65-
"startTime": "2026-12-11T19:00:00",
66-
"endTime": "2026-12-11T21:00:00",
68+
"startTime": "2026-12-20T19:00:00",
69+
"endTime": "2026-12-20T21:00:00",
6770
"tags": [
6871
"참여취소테스트",
6972
"자바"
@@ -89,7 +92,7 @@ Authorization: Bearer {{host2AccessToken}}
8992
%}
9093

9194

92-
### 회원가입(MEMBER 1)
95+
### 2. 회원가입(MEMBER 1)
9396
POST http://localhost:8080/api/v1/auth/signup
9497
Content-Type: application/json
9598

@@ -104,7 +107,8 @@ Content-Type: application/json
104107
client.global.set("c_memberId1", response.body.data.userId);
105108
%}
106109

107-
### 로그인(MEMBER 1)
110+
111+
### 2-1. 로그인(MEMBER 1)
108112
POST http://localhost:8080/api/v1/auth/login
109113
Content-Type: application/json
110114

@@ -117,7 +121,8 @@ Content-Type: application/json
117121
client.global.set("c_member1AccessToken", response.body.data.accessToken);
118122
%}
119123

120-
### 회원가입(MEMBER 2)
124+
125+
### 3. 회원가입(MEMBER 2)
121126
POST http://localhost:8080/api/v1/auth/signup
122127
Content-Type: application/json
123128

@@ -132,7 +137,8 @@ Content-Type: application/json
132137
client.global.set("c_memberId2", response.body.data.userId);
133138
%}
134139

135-
### 로그인(MEMBER 2)
140+
141+
### 3-1. 로그인(MEMBER 2)
136142
POST http://localhost:8080/api/v1/auth/login
137143
Content-Type: application/json
138144

@@ -153,38 +159,44 @@ Authorization: Bearer {{c_member1AccessToken}}
153159

154160
{}
155161

162+
156163
### 4-2. V2 MEMBER 2 참여
157164
POST http://localhost:8080/api/v2/groups/{{groupId_cancelTest}}/attend
158165
Content-Type: application/json
159166
Authorization: Bearer {{c_member2AccessToken}}
160167

161168
{}
162169

170+
163171
### 5-1. V2 MEMBER 1 참여 취소 (성공 케이스)
164172
POST http://localhost:8080/api/v2/groups/{{groupId_cancelTest}}/left
165173
Content-Type: application/json
166174
Authorization: Bearer {{c_member1AccessToken}}
167175

168176
{}
169177

170-
### 5-2. 예외발생: MEMBER 1 다시 취소 시도 (예외: NOT_ATTEND_GROUP)
178+
179+
### 5-2. 예외발생: MEMBER 1 다시 취소 시도 (예외 기대: NOT_ATTEND_GROUP)
171180
POST http://localhost:8080/api/v2/groups/{{groupId_cancelTest}}/left
172181
Content-Type: application/json
173182
Authorization: Bearer {{c_member1AccessToken}}
174183

175184
{}
176185

177-
### 5-3. 예외발생: HOST가 자신의 모임 취소 시도
186+
187+
### 5-3. 예외발생: HOST가 자신의 모임 취소 시도 (HOST는 left 불가)
178188
POST http://localhost:8080/api/v2/groups/{{groupId_cancelTest}}/left
179189
Content-Type: application/json
180190
Authorization: Bearer {{host2AccessToken}}
181191

182192
{}
183193

184-
### 5-4. (선택) 모임 참가자가 현재 모임 상세 조회 - 참여 인원 / 상태 확인
194+
195+
### 5-4. (선택) 모임 참가자(MEMBER 2) 상세 조회 - 참여 인원 / 상태 확인
185196
GET http://localhost:8080/api/v2/groups/{{groupId_cancelTest}}
186197
Authorization: Bearer {{c_member2AccessToken}}
187198

188-
### 5-5. (선택) 모임 HOST가 현재 모임 상세 조회 - 참여 인원 / 상태 확인
199+
200+
### 5-5. (선택) 모임 HOST 상세 조회 - 참여 인원 / 상태 확인
189201
GET http://localhost:8080/api/v2/groups/{{groupId_cancelTest}}
190202
Authorization: Bearer {{host2AccessToken}}

0 commit comments

Comments
 (0)