Skip to content

Commit

Permalink
feat: 행사 생성/수정 시 imageUrl을 받지 않도록 수정
Browse files Browse the repository at this point in the history
- EventDetailRequest에서 imageUrl 제거

#664
  • Loading branch information
amaran-th committed Sep 28, 2023
1 parent e1f465d commit 7f8f6b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ void updateEventTest() throws Exception {
event.getLocation(), event.getInformationUrl(), event.getEventPeriod().getStartDate(),
event.getEventPeriod().getEndDate(),
event.getEventPeriod().getApplyStartDate(), event.getEventPeriod().getApplyEndDate(),
tags, event.getImageUrl(), event.getType(), EventMode.ON_OFFLINE, PaymentType.FREE,
tags, event.getType(), EventMode.ON_OFFLINE, PaymentType.FREE,
"행사기관");

final EventDetailResponse response = new EventDetailResponse(1L, request.getName(),
request.getInformationUrl(), request.getStartDateTime(), request.getEndDateTime(),
request.getApplyStartDateTime(), request.getApplyEndDateTime(),
request.getLocation(), EventStatus.IN_PROGRESS.name(), EventStatus.ENDED.name(),
tags.stream().map(TagRequest::getName).collect(Collectors.toList()),
request.getImageUrl(), 10, 10, request.getType().toString(),
"image1.jpg", 10, 10, request.getType().toString(),
List.of("imageUrl1", "imageUrl2"), "행사기관", "유료");

Mockito.when(eventService.updateEvent(eq(eventId), any(EventDetailRequest.class), any(), any()))
Expand Down Expand Up @@ -332,15 +332,15 @@ void addEventTest() throws Exception {
event.getLocation(), event.getInformationUrl(), event.getEventPeriod().getStartDate(),
event.getEventPeriod().getEndDate(),
event.getEventPeriod().getApplyStartDate(), event.getEventPeriod().getApplyEndDate(),
tags, event.getImageUrl(), event.getType(), EventMode.ON_OFFLINE, PaymentType.FREE,
tags, event.getType(), EventMode.ON_OFFLINE, PaymentType.FREE,
"행사기관");

final EventDetailResponse response = new EventDetailResponse(1L, request.getName(),
request.getInformationUrl(), request.getStartDateTime(), request.getEndDateTime(),
request.getApplyStartDateTime(), request.getApplyEndDateTime(),
request.getLocation(), EventStatus.IN_PROGRESS.name(), EventStatus.ENDED.name(),
tags.stream().map(TagRequest::getName).collect(Collectors.toList()),
request.getImageUrl(), 10, 10, request.getType().toString(),
"image1.jpg", 10, 10, request.getType().toString(),
List.of("imageUrl1", "imageUrl2"), "행사기관", "무료");

Mockito.when(eventService.addEvent(any(EventDetailRequest.class), any(), any()))
Expand Down Expand Up @@ -412,7 +412,7 @@ void addEventWithEmptyNameTest(final String eventName) throws Exception {
eventName, event.getLocation(), event.getInformationUrl(), event.getEventPeriod()
.getStartDate(), event.getEventPeriod().getEndDate(),
event.getEventPeriod().getApplyStartDate(), event.getEventPeriod().getApplyEndDate(),
tags, event.getImageUrl(), event.getType(), event.getEventMode(),
tags, event.getType(), event.getEventMode(),
event.getPaymentType(), event.getOrganization());
final String contents = objectMapper.writeValueAsString(request);
//when & then
Expand Down Expand Up @@ -453,7 +453,7 @@ void addEventWithEmptyLocationTest(final String eventLocation) throws Exception
event.getName(), eventLocation, event.getInformationUrl(), event.getEventPeriod()
.getStartDate(), event.getEventPeriod().getEndDate(),
event.getEventPeriod().getApplyStartDate(), event.getEventPeriod().getApplyEndDate(),
tags, event.getImageUrl(), event.getType(), event.getEventMode(),
tags, event.getType(), event.getEventMode(),
event.getPaymentType(), event.getOrganization());
final String contents = objectMapper.writeValueAsString(request);
//when & then
Expand Down Expand Up @@ -495,7 +495,7 @@ void addEventWithInvalidInformationUrlTest(final String informationUrl) throws E
event.getName(), event.getLocation(), informationUrl, event.getEventPeriod()
.getStartDate(), event.getEventPeriod().getEndDate(),
event.getEventPeriod().getApplyStartDate(), event.getEventPeriod().getApplyEndDate(),
tags, event.getImageUrl(), event.getType(), event.getEventMode(),
tags, event.getType(), event.getEventMode(),
event.getPaymentType(), event.getOrganization());
final String contents = objectMapper.writeValueAsString(request);
//when & then
Expand Down Expand Up @@ -540,7 +540,6 @@ void addEventWithUnformattedStartDateTimeTest(final String startDateTime)
request.put("endDateTime", event.getEventPeriod().getEndDate().toString());
request.put("applyStartDateTime", event.getEventPeriod().getApplyStartDate().toString());
request.put("applyEndDateTime", event.getEventPeriod().getApplyEndDate().toString());
request.put("imageUrl", event.getImageUrl());
request.put("type", event.getType().name());
request.put("eventMode", event.getEventMode().name());
request.put("paymentType", event.getPaymentType().name());
Expand Down Expand Up @@ -588,7 +587,6 @@ void addEventWithUnformattedEndDateTimeTest(final String endDateTime) throws Exc
request.put("endDateTime", endDateTime);
request.put("applyStartDateTime", event.getEventPeriod().getApplyStartDate().toString());
request.put("applyEndDateTime", event.getEventPeriod().getApplyEndDate().toString());
request.put("imageUrl", event.getImageUrl());
request.put("type", event.getType().name());
request.put("eventMode", event.getEventMode().name());
request.put("paymentType", event.getPaymentType().name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public class EventDetailRequest {
private final LocalDateTime applyEndDateTime;

private final List<TagRequest> tags;

private final String imageUrl;
private final EventType type;

private final EventMode eventMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,6 @@ class AddEvent {
@DisplayName("이벤트를 성공적으로 저장한다.")
void addEventTest() {
//given
final Image image1 = new Image("image", ImageType.EVENT, 1L, 0, LocalDateTime.now());
final Image image2 = new Image("image", ImageType.EVENT, 1L, 0, LocalDateTime.now());

final EventDetailRequest request = new EventDetailRequest(
eventName,
eventLocation,
Expand All @@ -594,7 +591,6 @@ void addEventTest() {
beforeDateTime,
afterDateTime,
tagRequests,
imageUrl,
type,
eventMode,
paymentType,
Expand Down Expand Up @@ -639,7 +635,6 @@ void addEventWithStartDateTimeAfterBeforeDateTimeTest() {
beforeDateTime,
afterDateTime,
tagRequests,
imageUrl,
type,
eventMode,
paymentType,
Expand Down Expand Up @@ -674,7 +669,6 @@ void addEventWithNotExistTagTest() {
beforeDateTime,
afterDateTime,
tagRequests,
imageUrl,
type,
eventMode,
paymentType,
Expand Down Expand Up @@ -703,7 +697,6 @@ class UpdateEvent {
private final String newName = "새로운 이름";
private final String newLocation = "새로운 장소";
private final String newInformationUrl = "https://새로운-상세-URL.com";
private final String imageUrl = "https://image.com";
private final LocalDate now = LocalDate.now();
private final PaymentType paymentType = PaymentType.FREE_PAID;
private final EventMode eventMode = EventMode.ON_OFFLINE;
Expand All @@ -725,7 +718,6 @@ void updateEventTest() {
beforeDateTime,
afterDateTime,
newTagRequests,
imageUrl,
EventType.CONFERENCE,
eventMode,
paymentType,
Expand Down Expand Up @@ -771,7 +763,6 @@ void updateEventWithNotExistsEventTest() {
beforeDateTime,
afterDateTime,
newTagRequests,
imageUrl,
EventType.CONFERENCE,
eventMode,
paymentType,
Expand Down Expand Up @@ -801,7 +792,6 @@ void updateEventWithStartDateTimeAfterBeforeDateTimeTest() {
beforeDateTime,
afterDateTime,
newTagRequests,
imageUrl,
EventType.CONFERENCE,
eventMode,
paymentType,
Expand Down Expand Up @@ -835,7 +825,6 @@ void updateEventWithNotExistTagTest() {
beforeDateTime,
afterDateTime,
newTagRequests,
imageUrl,
EventType.CONFERENCE,
eventMode,
paymentType,
Expand Down

0 comments on commit 7f8f6b1

Please sign in to comment.