2025-05-11 17:21:07 +08:00
|
|
|
package com.bipt.intelligentapplicationorchestrationservice;
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
2025-05-13 10:47:23 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2025-05-11 17:21:07 +08:00
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
2025-05-13 10:47:23 +08:00
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
|
|
|
2025-05-11 17:21:07 +08:00
|
|
|
@SpringBootTest
|
|
|
|
class IntelligentApplicationOrchestrationServiceApplicationTests {
|
2025-05-13 10:47:23 +08:00
|
|
|
@Autowired
|
|
|
|
private DataSource dataSource;
|
2025-05-11 17:21:07 +08:00
|
|
|
@Test
|
2025-05-13 10:47:23 +08:00
|
|
|
void contextLoads() throws SQLException {
|
|
|
|
// 尝试获取连接
|
|
|
|
assertNotNull(dataSource.getConnection(), "无法获取数据库连接!");
|
|
|
|
System.out.println("数据库连接成功!");
|
2025-05-11 17:21:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|