Xin chào,
Mọi người cho mình hỏi có cách nào cấu hình sử dụng @MockBean với Spring boot test and Cucumber?
Dựa trên câu hỏi thread này mình setup chạy bình thường. Nhưng nếu mình apply thêm cả cucumber vào thì @MockBean không được.
Spring Boot Integration test sử dụng có cả mockup lẫn service thật
1. Add dependencies thế này:
2. Tạo file
hello-and-goodbye.feature
thế này trong folersrc/test/resources
:3. Tạo file
CucumberGoodbyeControllerTest
thế này:4. Tạo file
CucumberGoodbyeControllerStepsTest
thế này:Run
CucumberGoodbyeControllerTest
file and done!!!