1、导入依赖
org.projectlombok lombokorg.springframework.boot spring-boot-starter-testtest
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()); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)