Files
intelligent-application-orc…/src/test/java/com/bipt/intelligentapplicationorchestrationservice/IntelligentApplicationOrchestrationServiceApplicationTests.java

25 lines
682 B
Java

package com.bipt.intelligentapplicationorchestrationservice;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import javax.sql.DataSource;
import java.sql.SQLException;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@SpringBootTest
class IntelligentApplicationOrchestrationServiceApplicationTests {
@Autowired
private DataSource dataSource;
@Test
void contextLoads() throws SQLException {
// 尝试获取连接
assertNotNull(dataSource.getConnection(), "无法获取数据库连接!");
System.out.println("数据库连接成功!");
}
}