-
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.
Marc Gorzala
committed
Dec 15, 2023
1 parent
8efd185
commit 5d450e9
Showing
4 changed files
with
16 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ public class GetChats { | |
void getChatsShouldReturnChats() throws Exception { | ||
|
||
ChatDto chat = new ChatDto(); | ||
chat.setDancerIds(List.of(dancerId, UUID.randomUUID())); | ||
chat.setParticipantIds(List.of(dancerId, UUID.randomUUID())); | ||
chat.setChatId(chatId); | ||
ChatsDto chats = new ChatsDto(); | ||
chats.setChats(List.of(chat)); | ||
|
@@ -81,7 +81,7 @@ void postChatShouldReturnTheChat() throws Exception { | |
chat.setParticipantIds(dancerIds); | ||
|
||
ChatDto createdChat = new ChatDto(); | ||
createdChat.setDancerIds(dancerIds); | ||
createdChat.setParticipantIds(dancerIds); | ||
createdChat.setChatId(UUID.randomUUID()); | ||
|
||
when(chatServiceClient.createChat(chat)).thenReturn(createdChat); | ||
|
@@ -92,7 +92,7 @@ void postChatShouldReturnTheChat() throws Exception { | |
.andExpect(status().isCreated()) | ||
.andExpect(header().exists("Location")); | ||
|
||
result.andExpect(jsonPath("$.dancerIds").isNotEmpty()); | ||
result.andExpect(jsonPath("$.participantIds").isNotEmpty()); | ||
result.andExpect(jsonPath("$.chatId").isNotEmpty()); | ||
} | ||
|
||
|
@@ -121,7 +121,7 @@ void getChatShouldReturnTheChat() throws Exception { | |
UUID dancerId = dancerRepository.findByUserId(userId).get().getId(); | ||
|
||
ChatDto chat = new ChatDto(); | ||
chat.setDancerIds(List.of(dancerId, UUID.randomUUID())); | ||
chat.setParticipantIds(List.of(dancerId, UUID.randomUUID())); | ||
chat.setChatId(chatId); | ||
|
||
when(chatServiceClient.getChat(chatId)).thenReturn(chat); | ||
|
@@ -137,7 +137,7 @@ void getChatShouldReturnTheChat() throws Exception { | |
@WithUserDetails("[email protected]") | ||
void getChatShouldNotReturnTheChatIfUserIsNotPartOfIt() throws Exception { | ||
ChatDto chat = new ChatDto(); | ||
chat.setDancerIds(List.of(UUID.randomUUID(), UUID.randomUUID())); | ||
chat.setParticipantIds(List.of(UUID.randomUUID(), UUID.randomUUID())); | ||
chat.setChatId(chatId); | ||
|
||
when(chatServiceClient.getChat(chatId)).thenReturn(chat); | ||
|
@@ -156,7 +156,7 @@ public class GetMessages { | |
@WithUserDetails("[email protected]") | ||
void getMessagesShouldNotReturnMessagesIfUserIsNotInChat() throws Exception { | ||
ChatDto chat = new ChatDto(); | ||
chat.setDancerIds(List.of(UUID.randomUUID(), UUID.randomUUID())); | ||
chat.setParticipantIds(List.of(UUID.randomUUID(), UUID.randomUUID())); | ||
|
||
when(chatServiceClient.getChat(chatId)).thenReturn(chat); | ||
|
||
|
@@ -172,7 +172,7 @@ void getMessagesShouldReturnMessagesIfUserIsInChat() throws Exception { | |
UUID dancerId = dancerRepository.findByUserId(userId).get().getId(); | ||
|
||
ChatDto chat = new ChatDto(); | ||
chat.setDancerIds(List.of(dancerId, UUID.randomUUID())); | ||
chat.setParticipantIds(List.of(dancerId, UUID.randomUUID())); | ||
|
||
MessagesDto messages = new MessagesDto(); | ||
MessageDto message = new MessageDto(); | ||
|
@@ -199,7 +199,7 @@ public class PostMessages { | |
@WithUserDetails("[email protected]") | ||
void postMessagesShouldNotCreateTheMessageIfUserIsNotInTheChat() throws Exception { | ||
ChatDto chat = new ChatDto(); | ||
chat.setDancerIds(List.of(UUID.randomUUID(), UUID.randomUUID())); | ||
chat.setParticipantIds(List.of(UUID.randomUUID(), UUID.randomUUID())); | ||
|
||
CreateMessageDto message = new CreateMessageDto(); | ||
message.setText("Hallo"); | ||
|
@@ -219,7 +219,7 @@ void postMessagesShouldNotCreateTheMessageIfUserIsNotInTheChat() throws Exceptio | |
@WithUserDetails("[email protected]") | ||
void postMessagesShouldCreateAMessage() throws Exception { | ||
ChatDto chat = new ChatDto(); | ||
chat.setDancerIds(List.of(dancerId, UUID.randomUUID())); | ||
chat.setParticipantIds(List.of(dancerId, UUID.randomUUID())); | ||
|
||
CreateMessageDto message = new CreateMessageDto(); | ||
message.setText("Hallo"); | ||
|