-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GETP-185 fix: 피플 프로필이 미등록 상태임에도 등록할 수 없는 오류 수정 (#118)
- Loading branch information
Showing
7 changed files
with
65 additions
and
10 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
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
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
41 changes: 41 additions & 0 deletions
41
src/test/java/es/princip/getp/domain/like/query/dao/ZeroTestSizePeopleLikeDaoTest.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,41 @@ | ||
package es.princip.getp.domain.like.query.dao; | ||
|
||
import es.princip.getp.domain.like.query.infra.PeopleLikeDaoConfig; | ||
import es.princip.getp.infra.support.DaoTest; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Import; | ||
|
||
import java.util.Map; | ||
import java.util.stream.LongStream; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@Slf4j | ||
@Import(PeopleLikeDaoConfig.class) | ||
public class ZeroTestSizePeopleLikeDaoTest extends DaoTest { | ||
|
||
public ZeroTestSizePeopleLikeDaoTest() { | ||
super(0); | ||
} | ||
|
||
@Autowired | ||
private PeopleLikeDao peopleLikeDao; | ||
|
||
@Test | ||
void 피플_ID에_대해_피플이_받은_좋아요_수를_조회한다() { | ||
assertThat(peopleLikeDao.countByLikedId(1L)).isEqualTo(0); | ||
} | ||
|
||
@Test | ||
void 여러개의_피플_ID에_대해_피플이_받은_좋아요_수를_조회한다() { | ||
final Long[] peopleIds = LongStream.rangeClosed(1, 10) | ||
.boxed() | ||
.toArray(Long[]::new); | ||
final Map<Long, Long> likesCounts = peopleLikeDao.countByLikedIds(peopleIds); | ||
assertThat(likesCounts).hasSize(peopleIds.length) | ||
.containsOnlyKeys(peopleIds) | ||
.containsValues(Long.valueOf(0)); | ||
} | ||
} |