File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/test/java/com/example/log4u/domain/follow Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 22
33import static org .junit .jupiter .api .Assertions .*;
44
5+ import java .sql .Connection ;
6+ import java .sql .DriverManager ;
7+ import java .sql .SQLException ;
58import java .time .LocalDateTime ;
69import 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 예외 발생" )
You can’t perform that action at this time.
0 commit comments