1:pom.xml依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>2.2.13.RELEASE</version> <scope>test</scope> </dependency>
2:测试类
import com.oigcn.dataplatform.sqllineage.service.SqlLineageService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(classes = com.oigcn.dataplatform.sqllineage.SqlLineageApplication.class) public class TestInitSqlLine { @Autowired public SqlLineageService sqlLineageService; @Test public void test1(){ String rootPath = "E:\\code\\my_workspace\\Data_warehouse\\DWH_DWD\\BI\\"; sqlLineageService.initSqlLine(rootPath); } }