1、导入依赖
org.projectlombok lombok org.springframework.boot spring-boot-starter-test test
2、编写测试
import com.zrar.easyweb.oam.baseTest;
import com.zrar.easyweb.oam.OamApplication;
import lombok.extern.slf4j.Slf4j;
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.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = OamApplication.class)//springboot应用
@Slf4j//lombok包里的log注解
public class UserServiceTest2{
@Autowired
private UserService userService;
@Test
public void test1(){
log.error(userService.passwordStrengthCheck1("123456A@").toString());
}
}



