Skip to content

Commit 0926c99

Browse files
committed
fix: Cheer 의 생성자 수정
- id 값을 받지 않도록 함
1 parent 2135166 commit 0926c99

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/eatda/domain/store/Cheer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ public class Cheer {
4747
@Column(name = "created_at", nullable = false)
4848
private LocalDateTime createdAt;
4949

50-
public Cheer(Long id, Member member, Store store, String description, String imageKey) {
50+
public Cheer(Member member, Store store, String description, String imageKey) {
5151
validateDescription(description);
5252
validateImageKey(imageKey);
53-
this.id = id;
5453
this.member = member;
5554
this.store = store;
5655
this.description = description;

src/test/java/eatda/domain/store/CheerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ class Validate {
3535
@NullAndEmptySource
3636
void 설명이_비어있으면_안된다(String description) {
3737
BusinessException exception = assertThrows(BusinessException.class, () -> {
38-
new Cheer(1L, DEFAULT_MEMBER, DEFAULT_STORE, description, "imageKey");
38+
new Cheer(DEFAULT_MEMBER, DEFAULT_STORE, description, "imageKey");
3939
});
4040

4141
assertThat(exception.getErrorCode()).isEqualTo(BusinessErrorCode.INVALID_CHEER_DESCRIPTION);
4242
}
4343

4444
@Test
4545
void 이미지_키는_null이_가능하다() {
46-
assertThatCode(() -> new Cheer(1L, DEFAULT_MEMBER, DEFAULT_STORE, "Great store!", null))
46+
assertThatCode(() -> new Cheer(DEFAULT_MEMBER, DEFAULT_STORE, "Great store!", null))
4747
.doesNotThrowAnyException();
4848
}
4949

5050
@ParameterizedTest
5151
@ValueSource(strings = {"", " ", "\t\n"})
5252
void 이미지_키는_비어있으면_안된다(String imageKey) {
5353
BusinessException exception = assertThrows(BusinessException.class, () -> {
54-
new Cheer(1L, DEFAULT_MEMBER, DEFAULT_STORE, "Great store!", "");
54+
new Cheer(DEFAULT_MEMBER, DEFAULT_STORE, "Great store!", imageKey);
5555
});
5656

5757
assertThat(exception.getErrorCode()).isEqualTo(BusinessErrorCode.INVALID_CHEER_IMAGE_KEY);

0 commit comments

Comments
 (0)