Skip to content

Commit 9686104

Browse files
committed
test: 테스트 코드 수정(MIKKI-216)
1 parent 40a9382 commit 9686104

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

backend/src/test/java/com/backend/domain/reservation/service/ReservationConcurrencyTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,17 @@ void t01() throws Exception {
166166
shipFishingPostId, reservationDateValue)
167167
.orElseThrow(() -> new RuntimeException("ReservationDate not found"));
168168

169+
exceptions.stream()
170+
.map(AtomicReference::get)
171+
.filter(Objects::nonNull)
172+
.forEach(e -> log.debug("예외 발생", e));
173+
169174
// Then
170175
assertThat(updatedReservationDate.getRemainCount()).isEqualTo(5);
171176

172177
// 둘중 한 요청은 remainCount 부족으로 예외가 발생해야 함
173178
boolean exceptionOccurred = exceptions.stream().anyMatch(ref -> ref.get() != null);
174179
assertThat(exceptionOccurred).isTrue();
175-
exceptions.stream()
176-
.map(AtomicReference::get)
177-
.filter(Objects::nonNull)
178-
.forEach(e -> log.error("예외 발생", e));
179180
}
180181

181182
@Test
@@ -211,7 +212,7 @@ void t02() throws Exception {
211212
exceptions.stream()
212213
.map(AtomicReference::get)
213214
.filter(Objects::nonNull)
214-
.forEach(e -> log.error("예외 발생", e));
215+
.forEach(e -> log.debug("예외 발생", e));
215216

216217
// Then
217218
long errorCount = exceptions.stream().filter(ref -> ref.get() != null).count();

backend/src/test/java/com/backend/domain/reservationdate/repository/ReservationDateRepositoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void t01() {
7373

7474
for (long i = 0; i < 100; i++) {
7575
givenResrvationList.add(fixtureMonkeyBuilder.giveMeBuilder(ReservationDate.class)
76-
.set("shipFishingPostId", i)
76+
.set("shipFishingPostId", 1L)
7777
.set("reservationDate", LocalDate.now().plusDays(i))
7878
.set("remainCount", 10)
7979
.sample());

0 commit comments

Comments
 (0)