1、pom.xml添加jar依赖

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <scope>test</scope>
  <version>4.12</version>
</dependency>

2、测试类

import com.xfz.App;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = App.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class EncryptorTest {

    @Test
    public void getPass() {
        System.out.println(123);
    }
}

 

posted on 2018-10-26 15:31  df-xfz  阅读(114)  评论(0编辑  收藏  举报