fix(gift): 카테고리 접수 코드 중복을 허용한다
This commit is contained in:
+11
-4
@@ -92,7 +92,7 @@ class GiftEntityMappingTest @Autowired constructor(
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("신청번호와 카테고리 unique 값과 리뷰 선물 ID는 중복 저장할 수 없다")
|
||||
@DisplayName("신청번호와 카테고리 분류번호 및 코드와 리뷰 선물 ID는 중복 저장할 수 없다")
|
||||
fun shouldRejectDuplicateUniqueValues() {
|
||||
val category = giftCategoryRepository.save(giftCategory("100", "DOLL", "A"))
|
||||
val gift = giftRepository.save(gift(category.id!!, "G20260929000001"))
|
||||
@@ -108,14 +108,21 @@ class GiftEntityMappingTest @Autowired constructor(
|
||||
assertThrows(DataIntegrityViolationException::class.java) {
|
||||
giftCategoryRepository.saveAndFlush(giftCategory("100", "TOY", "B"))
|
||||
}
|
||||
assertThrows(DataIntegrityViolationException::class.java) {
|
||||
giftCategoryRepository.saveAndFlush(giftCategory("101", "TOY", "A"))
|
||||
}
|
||||
assertThrows(DataIntegrityViolationException::class.java) {
|
||||
giftReviewRepository.saveAndFlush(GiftReview(giftId = gift.id!!, senderMemberId = 1L, rating = 4))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("카테고리 접수 코드는 중복 저장할 수 있다")
|
||||
fun shouldAllowDuplicateReceiptCode() {
|
||||
val first = giftCategoryRepository.saveAndFlush(giftCategory("100", "DOLL", "A"))
|
||||
val second = giftCategoryRepository.saveAndFlush(giftCategory("101", "TOY", "A"))
|
||||
|
||||
assertNotNull(first.id)
|
||||
assertNotNull(second.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("카테고리와 날짜별 신청번호 채번 sequence를 저장한다")
|
||||
fun shouldSaveApplicationNoSequence() {
|
||||
|
||||
Reference in New Issue
Block a user