1、springboot 测试
pom文件配置信息:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
@RunWith(SpringRunner.class) //启动器
@SpringBootTest //测试
public class UserServiceTest {
@Autowired
UserService userService;
@Test
public void getUserName(){
System.out.println("userName:"+userService.getUserName());
}
}
以上是自学总结。有借鉴前辈帖子望见谅。不足之处请多多指教