整合了JPA和mysql需要来测试一下是否可以成功对数据库进行操作,这里写一个简单的单元测试来对之前配置的正确性进行验证。
依赖导入
首先导入需要的SpringTest包和Junit单元测试包。
<!-- spring-boot-starter-test依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</d