提交 | 用户 | 时间
|
e7c126
|
1 |
package com.xxl.job.admin.controller; |
H |
2 |
|
|
3 |
import org.junit.jupiter.api.BeforeEach; |
|
4 |
import org.springframework.beans.factory.annotation.Autowired; |
|
5 |
import org.springframework.boot.test.context.SpringBootTest; |
|
6 |
import org.springframework.test.web.servlet.MockMvc; |
|
7 |
import org.springframework.test.web.servlet.setup.MockMvcBuilders; |
|
8 |
import org.springframework.web.context.WebApplicationContext; |
|
9 |
|
|
10 |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
|
11 |
public class AbstractSpringMvcTest { |
|
12 |
|
|
13 |
@Autowired |
|
14 |
private WebApplicationContext applicationContext; |
|
15 |
protected MockMvc mockMvc; |
|
16 |
|
|
17 |
@BeforeEach |
|
18 |
public void setup() { |
|
19 |
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.applicationContext).build(); |
|
20 |
} |
|
21 |
|
|
22 |
} |