Skip to content

Commit

Permalink
fix: 현재 시간 계산 로직에 누락된 clock 추가 (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChooSeoyeon authored Oct 17, 2024
1 parent 8c9cb5c commit 1ad2ccc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.zzang.chongdae.global.domain.DomainSupplier;
import com.zzang.chongdae.global.helper.CookieProvider;
import com.zzang.chongdae.global.helper.DatabaseCleaner;
import java.time.Clock;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -20,6 +21,9 @@ public abstract class ServiceTest extends DomainSupplier {
@Autowired
protected CookieProvider cookieProvider;

@Autowired
protected Clock clock;

@BeforeEach
protected void setUp() {
databaseCleaner.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ void should_createOffering_when_givenOfferingCreateRequest() {
"서울특별시 광진구 구의강변로 3길 11",
"상세주소아파트",
"구의동",
LocalDateTime.now().plusDays(1),
LocalDateTime.now(clock).plusDays(1),
"내용입니다."
);

Expand All @@ -540,7 +540,7 @@ void should_createOffering_when_givenOfferingWithoutOriginPriceCreateRequest() {
"서울특별시 광진구 구의강변로 3길 11",
"상세주소아파트",
"구의동",
LocalDateTime.now().plusDays(1),
LocalDateTime.now(clock).plusDays(1),
"내용입니다."
);

Expand Down Expand Up @@ -648,7 +648,7 @@ void should_throwException_when_meetingDateBeforeTomorrow() {
"서울특별시 광진구 구의강변로 3길 11",
"상세주소아파트",
"구의동",
LocalDateTime.now().minusDays(1),
LocalDateTime.now(clock).minusDays(1),
"내용입니다."
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ void should_createOffering_when_givenOfferingWithoutOriginPriceCreateRequest() {
"서울특별시 광진구 구의강변로 3길 11",
"상세주소아파트",
"구의동",
LocalDateTime.now().plusDays(1),
LocalDateTime.now(clock).plusDays(1),
"내용입니다."
);
Long expected = 1L;
Expand Down

0 comments on commit 1ad2ccc

Please sign in to comment.