Skip to content

Commit 753664a

Browse files
committed
fix: db 연결 확인 테스트 추가
1 parent 6a4517f commit 753664a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/java/com/example/log4u/domain/follow/FollowTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import static org.junit.jupiter.api.Assertions.*;
44

5+
import java.sql.Connection;
6+
import java.sql.DriverManager;
7+
import java.sql.SQLException;
58
import java.time.LocalDateTime;
69
import java.util.UUID;
710

@@ -38,6 +41,19 @@ class FollowTest {
3841
private static final String WRONG_TARGET = "nonExistUser";
3942
private static final String TARGET = "targetUser";
4043

44+
@Test
45+
@DisplayName("테스트용 DB 연결 확인")
46+
void checkDatabaseConnection() {
47+
try (Connection connection = DriverManager.getConnection(
48+
"jdbc:mysql://localhost:3307/log4u",
49+
"dev",
50+
"devcos4-team08")) {
51+
assertFalse(connection.isClosed());
52+
} catch (SQLException e) {
53+
fail("데이터베이스 연결 실패: " + e.getMessage());
54+
}
55+
}
56+
4157
@Test
4258
@Transactional
4359
@DisplayName("팔로우 시 유저가 없어 USER NOT FOUND 예외 발생")

0 commit comments

Comments
 (0)