Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 현재 시간 계산 로직에 누락된 clock 추가 #580

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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