Skip to content

Commit

Permalink
test: 테스트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaPol committed Jan 9, 2024
1 parent faa2ec7 commit 9e58fcc
Showing 1 changed file with 16 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
package com.pgms.apievent.eventSeat.service;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.IntStream;

import com.pgms.apievent.EventTestConfig;
import com.pgms.apievent.eventSeat.dto.request.EventSeatsCreateRequest;
import com.pgms.apievent.eventSeat.dto.response.EventSeatResponse;
import com.pgms.apievent.eventSeat.dto.response.LeftEventSeatResponse;
import com.pgms.apievent.factory.event.EventFactory;
import com.pgms.apievent.factory.eventhall.EventHallFactory;
import com.pgms.coredomain.domain.event.*;
import com.pgms.coredomain.domain.event.repository.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.annotation.Transactional;

import com.pgms.apievent.EventTestConfig;
import com.pgms.apievent.eventSeat.dto.request.EventSeatsCreateRequest;
import com.pgms.apievent.eventSeat.dto.response.EventSeatResponse;
import com.pgms.apievent.eventSeat.dto.response.LeftEventSeatResponse;
import com.pgms.apievent.factory.event.EventFactory;
import com.pgms.apievent.factory.eventhall.EventHallFactory;
import com.pgms.coredomain.domain.event.Event;
import com.pgms.coredomain.domain.event.EventHall;
import com.pgms.coredomain.domain.event.EventSeatArea;
import com.pgms.coredomain.domain.event.EventSeatStatus;
import com.pgms.coredomain.domain.event.EventTime;
import com.pgms.coredomain.domain.event.SeatAreaType;
import com.pgms.coredomain.domain.event.repository.EventHallRepository;
import com.pgms.coredomain.domain.event.repository.EventRepository;
import com.pgms.coredomain.domain.event.repository.EventSeatAreaRepository;
import com.pgms.coredomain.domain.event.repository.EventSeatRepository;
import com.pgms.coredomain.domain.event.repository.EventTimeRepository;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.IntStream;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

@Transactional
@SpringBootTest
Expand Down Expand Up @@ -78,7 +68,7 @@ void setUp() {

List<EventSeatsCreateRequest> eventSeatsCreateRequests = IntStream.range(0, 20)
.mapToObj(i ->
new EventSeatsCreateRequest("", EventSeatStatus.AVAILABLE, eventSeatArea))
new EventSeatsCreateRequest("", EventSeatStatus.AVAILABLE, eventSeatArea.getId()))
.toList();

// when
Expand All @@ -104,7 +94,7 @@ void setUp() {

List<EventSeatsCreateRequest> eventSeatsCreateRequests = IntStream.range(0, 20)
.mapToObj(i ->
new EventSeatsCreateRequest("", EventSeatStatus.AVAILABLE, eventSeatArea))
new EventSeatsCreateRequest("", EventSeatStatus.AVAILABLE, eventSeatArea.getId()))
.toList();
eventSeatService.createEventSeats(event.getId(), eventSeatsCreateRequests);

Expand Down

0 comments on commit 9e58fcc

Please sign in to comment.