I am using Gauge to automate the test of services and controller. In springboot test,I can use :
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = CustomMvcConfiguration.class)
@WebAppConfiguration
public class UserApiTest {
private MockMvc mockMvc;
@Autowired
private WebApplicationContext webApplicationContext;
Now, use gauge run,WebApplicationContext can't be AutoWired!
Aucun commentaire:
Enregistrer un commentaire