springboot test
1.springboot测试
1.使用的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
2.使用
@SpringBootTest(classes = ShiroDemoApplication.class) // 这里的启动类.class
public class AccountMapperTest {
@Autowired
private AccountMapper accountMapper;
@Test
public void test01(){
List<Account> accountList = accountMapper.selectList(new QueryWrapper<Account>());
accountList.forEach(System.out::println);
System.out.println();
}
}
2.普通的测试 没有spring环境
public class DesTest {
@Test
public void test2(){
Integer a = 127;
Integer b = 127;
System.out.println(a == b);
}
}