-
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.
# Conflicts: # src/main/java/com/chat/yourway/dto/response/MessageNotificationResponseDto.java # src/main/java/com/chat/yourway/service/ChatMessageServiceImpl.java # src/test/java/com/chat/yourway/integration/controller/ChatControllerTest.java
- Loading branch information
Showing
13 changed files
with
128 additions
and
37 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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/chat/yourway/dto/response/TopicNotificationResponseDto.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,23 @@ | ||
package com.chat.yourway.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Setter | ||
@Getter | ||
@ToString | ||
public class TopicNotificationResponseDto { | ||
|
||
private TopicResponseDto topic; | ||
|
||
private Integer unreadMessages; | ||
|
||
private LastMessageResponseDto lastMessage; | ||
|
||
|
||
} |
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
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 |
---|---|---|
|
@@ -202,7 +202,8 @@ void notifyTopicSubscribers_shouldNotifyTopicSubscribersIfSubscribeEvent() { | |
lastMessageDto.setSentFrom("[email protected]"); | ||
lastMessageDto.setLastMessage("Hi"); | ||
|
||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), lastMessageDto); | ||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), | ||
lastMessageDto); | ||
saveContactEvent(event); | ||
//Stored subscription results for testing | ||
CompletableFuture<MessageNotificationResponseDto[]> resultKeeper = new CompletableFuture<>(); | ||
|
@@ -218,9 +219,7 @@ void notifyTopicSubscribers_shouldNotifyTopicSubscribersIfSubscribeEvent() { | |
assertThat(notifications).extracting("email").contains("[email protected]"); | ||
assertThat(notifications).extracting("topicId").contains(topicId); | ||
assertThat(notifications).extracting("status").contains(ONLINE); | ||
assertThat(notifications).extracting("unreadMessages").isNotNull(); | ||
assertThat(notifications).extracting("lastRead").isNotNull(); | ||
assertThat(notifications).extracting("lastMessage").isNotNull(); | ||
} | ||
|
||
@Test | ||
|
@@ -234,7 +233,8 @@ void notifyTopicSubscribers_shouldNotifyTopicSubscribersIfAnyContactSubscribedTo | |
lastMessageDto.setSentFrom("[email protected]"); | ||
lastMessageDto.setLastMessage("Hi"); | ||
|
||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), lastMessageDto); | ||
var event = new ContactEvent("[email protected]", topicId, ONLINE, LocalDateTime.now(), | ||
lastMessageDto); | ||
saveContactEvent(event); | ||
//Stored subscription results for testing | ||
CompletableFuture<MessageNotificationResponseDto[]> resultKeeper = new CompletableFuture<>(); | ||
|
@@ -253,9 +253,7 @@ void notifyTopicSubscribers_shouldNotifyTopicSubscribersIfAnyContactSubscribedTo | |
assertThat(notifications).extracting("email").contains("[email protected]"); | ||
assertThat(notifications).extracting("topicId").contains(topicId); | ||
assertThat(notifications).extracting("status").contains(SUBSCRIBED); | ||
assertThat(notifications).extracting("unreadMessages").contains(0); | ||
assertThat(notifications).extracting("lastRead").isNotNull(); | ||
assertThat(notifications).extracting("lastMessage").isNotNull(); | ||
} | ||
|
||
//----------------------------------- | ||
|
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