-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01f65ca
commit 4b94592
Showing
6 changed files
with
45 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ class NotificationFcmServiceTest { | |
private User user; | ||
private User target; | ||
private User dummy; | ||
|
||
private Vote vote; | ||
private Question question; | ||
@BeforeEach | ||
void init() { | ||
this.notificationService = NotificationFcmService.builder() | ||
|
@@ -74,6 +75,19 @@ void init() { | |
.deletedAt(null).group(userGroup) | ||
.groupAdmissionYear(19).email("[email protected]") | ||
.build(); | ||
question = Question.builder() | ||
.id(1L) | ||
.nameHead(null).nameFoot("와") | ||
.keywordHead("멋진").keywordFoot("에서 놀고싶어") | ||
.build(); | ||
vote = Vote.builder() | ||
.id(1L) | ||
.colorIndex(0).answer("test") | ||
.isRead(false).nameHint(-1).isAnswerRevealed(false) | ||
.sender(userRepository.getById(1L)) | ||
.receiver(userRepository.getById(2L)) | ||
.question(question).createdAt(LocalDateTime.now()) | ||
.build(); | ||
} | ||
|
||
@Test | ||
|
@@ -120,6 +134,26 @@ void init() { | |
notificationService.sendFriendNotification(friend); | ||
} | ||
|
||
@Test | ||
void 친구가_내가_보낸_쪽지_열람시_알림_전송에_성공합니다() { | ||
//given | ||
target.setDeviceToken("test-device-token"); | ||
|
||
// when | ||
// then | ||
notificationService.sendOpenVoteNotification(vote.getSender()); | ||
} | ||
|
||
@Test | ||
void 추천인_코드_가입하여_열람권_얻은_경우_알림_전송에_성공합니다() { | ||
//given | ||
target.setDeviceToken("test-device-token"); | ||
|
||
// when | ||
// then | ||
notificationService.sendRecommendSignupAndGetTicketNotification(target); | ||
} | ||
|
||
@Test | ||
void 푸시_알림_전송_시_존재하지_않는_유저인_경우에_UserNotFoundException이_발생합니다() { | ||
// given | ||
|