Skip to content

Commit 7bfe838

Browse files
committed
Merge remote-tracking branch 'origin' into fix/#330-room-join-server-error
2 parents 31f79f8 + 4052fb7 commit 7bfe838

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:17
1+
FROM amazoncorretto:17
22

33
ARG PORT=8000
44
ENV JAVA_TOOL_OPTIONS="-Xms512m -Xmx2g -XX:+ExitOnOutOfMemoryError"
@@ -7,4 +7,4 @@ EXPOSE ${PORT}
77

88
COPY ./build/libs/*.jar ./app.jar
99

10-
ENTRYPOINT ["java", "-jar", "app.jar"]
10+
ENTRYPOINT ["java", "-jar", "app.jar"]

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,46 @@
1-
# THIP-Server
2-
THIP 백엔드 레포지토리입니다.
1+
# THIP
2+
3+
<div><img width="2396" height="1164" alt="image" src="https://github.com/user-attachments/assets/72856d5a-7521-4e98-b0a6-ad73bbb383ee" /></div>
4+
5+
## 프로젝트 소개
6+
7+
8+
**같은 책을 읽는 사람들과 감상을 공유하는 기록 중심 독서 플랫폼**
9+
10+
THIP은 웹과 앱을 통해 언제 어디서나 접근 가능한 커뮤니티형 독서 기록 플랫폼이에요.
11+
12+
원하는 책을 골라 독서하고 책에 대한 감상을 다양한 형태로 기록할 수 있어요.
13+
14+
## 백엔드 멤버
15+
16+
<table>
17+
<tbody>
18+
<tr>
19+
<td align="center"><a href="https://github.com/hd0rable">
20+
<img width=100px src="https://avatars.githubusercontent.com/u/131003143?v=4" alt=""/><br />
21+
<sub><b>강희진</b></sub></a><br /></td>
22+
<td align="center"><a href="https://github.com/seongjunnoh">
23+
<img width=100px src="https://avatars.githubusercontent.com/seongjunnoh?v=4" alt=""/><br />
24+
<sub><b>노성준</b></sub></a><br /></td>
25+
<td align="center"><a href="https://github.com/buzz0331">
26+
<img width=100px src="https://avatars.githubusercontent.com/u/130340360?v=4" alt=""/><br />
27+
<sub><b>장현준</b></sub></a><br /></td>
28+
</tr>
29+
</tbody>
30+
</table>
31+
32+
## 기술 스택
33+
34+
### 백엔드
35+
<img width="700" height="800" alt="image" src="https://github.com/user-attachments/assets/09beb52c-6336-42d5-acbc-36d60a4bd690" />
36+
37+
### 인프라
38+
<img width="700" height="300" alt="image" src="https://github.com/user-attachments/assets/b34701ca-e835-4782-8d53-a34e485fce9e" />
39+
40+
### 모니터링
41+
<img width="700" height="250" alt="image" src="https://github.com/user-attachments/assets/81588de4-03fd-407a-887b-837fb617290b" />
42+
43+
44+
## 시스템 아키텍처
45+
<br>
46+
<img width="1000" height="600" alt="image" src="https://github.com/user-attachments/assets/ec98384a-8d92-4d51-9ae7-0bdb10e67667" />

src/test/java/konkuk/thip/room/adapter/in/web/RoomCreateApiTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import konkuk.thip.book.adapter.out.jpa.BookJpaEntity;
66
import konkuk.thip.book.adapter.out.persistence.repository.BookJpaRepository;
7+
import konkuk.thip.book.application.port.out.BookApiQueryPort;
8+
import konkuk.thip.book.domain.Book;
79
import konkuk.thip.common.util.TestEntityFactory;
810
import konkuk.thip.room.adapter.out.jpa.RoomJpaEntity;
911
import konkuk.thip.room.adapter.out.jpa.RoomParticipantJpaEntity;
@@ -21,6 +23,7 @@
2123
import org.springframework.boot.test.context.SpringBootTest;
2224
import org.springframework.http.MediaType;
2325
import org.springframework.test.context.ActiveProfiles;
26+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2427
import org.springframework.test.web.servlet.MockMvc;
2528
import org.springframework.test.web.servlet.ResultActions;
2629
import org.springframework.transaction.annotation.Transactional;
@@ -31,6 +34,8 @@
3134
import java.util.Map;
3235

3336
import static org.assertj.core.api.Assertions.assertThat;
37+
import static org.mockito.ArgumentMatchers.anyString;
38+
import static org.mockito.Mockito.when;
3439
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
3540
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
3641
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -49,6 +54,7 @@ class RoomCreateApiTest {
4954
@Autowired private BookJpaRepository bookJpaRepository;
5055
@Autowired private RoomJpaRepository roomJpaRepository;
5156
@Autowired private RoomParticipantJpaRepository roomParticipantJpaRepository;
57+
@MockitoBean private BookApiQueryPort mockBookApiQueryPort;
5258

5359
private void saveUserAndLiteratureCategory() {
5460
Alias alias = TestEntityFactory.createLiteratureAlias();
@@ -158,6 +164,8 @@ void room_create_book_without_page_exist() throws Exception {
158164

159165
Map<String, Object> request = buildRoomCreateRequest();
160166

167+
when(mockBookApiQueryPort.findPageCountByIsbn(anyString())).thenReturn(296);
168+
161169
//when
162170
ResultActions result = mockMvc.perform(post("/rooms")
163171
.requestAttr("userId", userId)
@@ -204,6 +212,17 @@ void room_create_book_not_exist() throws Exception {
204212

205213
Map<String, Object> request = buildRoomCreateRequest();
206214

215+
Book mockBook = Book.withoutId(
216+
"작별하지 않는다",
217+
"9791168342941",
218+
"박곰희",
219+
false,
220+
"문학동네",
221+
"https://image1.jpg",
222+
296,
223+
"한강의 소설");
224+
when(mockBookApiQueryPort.loadBookWithPageByIsbn(anyString())).thenReturn(mockBook);
225+
207226
//when
208227
ResultActions result = mockMvc.perform(post("/rooms")
209228
.requestAttr("userId", userId)

0 commit comments

Comments
 (0)