-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
TestNG Version
Note: only the latest version is supported
7.0.0
Expected behavior
autowire MockMvc in springboot project
Actual behavior
cannot autowire MockMvc in springboot project
Is the issue reproductible on runner?
- Shell
- Maven
- Gradle
- Ant
- Eclipse
- IntelliJ
- NetBeans
Test case sample
Please, share the test case (as small as possible) which shows the issue
in springboot 2.1.7 project.
I test HTTP RESTful in controller layer, use MockMvc mock HTTP Request。
in @Test annotation method ,this MockMvc can be autowire,but,in @BeforeSuite annotation method, the MockMvc is null.
this class:
@SpringBootTest(classes = DmsServerApplication.class,
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@AutoConfigureMockMvc
public class MetaTest extends AbstractTestNGSpringContextTests {
@Autowired
private MockMvc mockMvc;
@BeforeSuite
public void setUp() throws Exception {
// mock request http
}
}what can i do ?
Metadata
Metadata
Assignees
Labels
No labels