-
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.
Merge pull request #88 from catchroom/feature/리팩토링-레디스-채팅방
Feature/리팩토링 레디스 채팅방
- Loading branch information
Showing
5 changed files
with
83 additions
and
8 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
48 changes: 48 additions & 0 deletions
48
src/test/java/com/catchroom/chat/message/repository/ChatRoomRedisRepositoryTest.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,48 @@ | ||
package com.catchroom.chat.message.repository; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import com.catchroom.chat.chatroom.dto.ChatRoomListGetResponse; | ||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
class ChatRoomRedisRepositoryTest { | ||
|
||
@Autowired | ||
private ChatRoomRedisRepository chatRoomRedisRepository; | ||
|
||
@Autowired | ||
ObjectMapper objectMapper; | ||
|
||
Logger log = (Logger) LoggerFactory.getLogger(ChatRoomRedisRepositoryTest.class); | ||
|
||
@Test | ||
void 채팅방_값_저장() { | ||
Long userId = 68L; | ||
} | ||
|
||
@Test | ||
void 채팅방_값이_제대로_저장됐을까() { | ||
Long userId = 10000L; | ||
List<ChatRoomListGetResponse> chatRoomListGetResponseList = chatRoomRedisRepository.getChatRoomList(userId); | ||
for (ChatRoomListGetResponse chatRoomListGetResponse : chatRoomListGetResponseList) { | ||
log.info( | ||
chatRoomListGetResponse.toString() | ||
); | ||
} | ||
} | ||
|
||
@Test | ||
void 채팅방_값이_제대로_불러와질까() { | ||
Long userId = 10000L; | ||
ChatRoomListGetResponse chatRoomListGetResponse = chatRoomRedisRepository.getChatRoom(userId, "c29cd80e-d289-49ff-ac91-f3b32dd4b633"); | ||
log.info(chatRoomListGetResponse.toString()); | ||
} | ||
} |