引入依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.1.6.RELEASE</version>
<scope>test</scope>
</dependency>
@RunWith(value = SpringRunner.class)
@SpringBootTest(classes = 启动类.class)
@ActiveProfiles("dev")
public class ApplicationTest {
@Before
public void init(){
System.out.println(
"init"
);
}
}
网友评论