Skip to content

Commit

Permalink
test: 바뀐 cart api에 의한 test 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
wocjf0513 committed Dec 15, 2023
1 parent fb92e7c commit fb4b2d5
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
import com.fc.shimpyo_be.domain.room.entity.RoomPrice;
import com.fc.shimpyo_be.domain.room.repository.RoomRepository;
import com.fc.shimpyo_be.global.util.DateTimeUtil;
import com.fc.shimpyo_be.global.util.SecurityUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import;

import java.time.LocalDate;
Expand All @@ -40,6 +42,7 @@
import org.springframework.security.test.context.support.WithMockUser;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.BDDMockito.given;

@Slf4j
@Import(TestDBCleanerConfig.class)
Expand All @@ -64,6 +67,9 @@ public class ReservationServiceTest extends AbstractContainersSupport {
@Autowired
private DatabaseCleanUp databaseCleanUp;

@MockBean
private SecurityUtil securityUtil;

private Member member;

private final String[] tableNameArray = {
Expand All @@ -90,6 +96,8 @@ void setUp() {
.build()
);

given(securityUtil.getCurrentMemberId()).willReturn(member.getId());

List<Product> products = new ArrayList<>();
for (int i = 1; i <= 3; i++) {
String productName = "호텔" + i;
Expand Down

0 comments on commit fb4b2d5

Please sign in to comment.