-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 원 가격이 없는 경우 n빵 가격을 비교하지 않도록 변경 (#247)
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
backend/src/test/java/com/zzang/chongdae/offering/service/OfferingServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.zzang.chongdae.offering.service; | ||
|
||
import com.zzang.chongdae.global.integration.IntegrationTest; | ||
import com.zzang.chongdae.member.repository.entity.MemberEntity; | ||
import com.zzang.chongdae.offering.service.dto.OfferingSaveRequest; | ||
import java.time.LocalDateTime; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
// TODO: service 테스트 환경도 IntegrationTest 동일하게 적용하지 않을 경우 data.sql 정보가 db에 저장됨 | ||
public class OfferingServiceTest extends IntegrationTest { | ||
|
||
@Autowired | ||
OfferingService offeringService; | ||
|
||
@DisplayName("공목 등록 시 원 가격 정보가 없더라도 공모 작성에 성공할 수 있다.") | ||
@Test | ||
void should_createOffering_when_givenOfferingWithoutOriginPriceCreateRequest() { | ||
|
||
// given | ||
MemberEntity member = memberFixture.createMember("pizza"); | ||
OfferingSaveRequest request = new OfferingSaveRequest( | ||
"공모 제목", | ||
"www.naver.com", | ||
"www.naver.com/favicon.ico", | ||
5, | ||
10000, | ||
null, | ||
"서울특별시 광진구 구의강변로 3길 11", | ||
"상세주소아파트", | ||
"구의동", | ||
LocalDateTime.parse("2024-10-11T10:00:00"), | ||
"내용입니다." | ||
); | ||
Long expected = 1L; | ||
|
||
// when | ||
Long actual = offeringService.saveOffering(request, member); | ||
|
||
// then | ||
Assertions.assertEquals(expected, actual); | ||
} | ||
} |