Cucumber with Spring Boot 1.4: Dependencies not injected when using @SpringBootTest and @RunWith(SpringRunner.class)

后端 未结 5 1623
情深已故
情深已故 2021-02-07 16:43

I am writing a new app and trying to do BDD using cucumber and Spring Boot 1.4. Working code is as shown below:

@SpringBootApplication
public class Application {         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-07 17:11

    This is my configuration, you can try it

    @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
    @ContextConfiguration(classes = {Application.class})
    

提交回复
热议问题