We Are Going To Discuss About Spring boot test “No qualifying bean of type available”. So lets Start this Java Article.
Spring boot test “No qualifying bean of type available”
- Spring boot test “No qualifying bean of type available”
The test environment needs to know where your beans are defined, so you have to tell it the location.
In your test class, add the@ContextConfiguration
annotation: - Spring boot test “No qualifying bean of type available”
The test environment needs to know where your beans are defined, so you have to tell it the location.
In your test class, add the@ContextConfiguration
annotation:
Solution 1
The test environment needs to know where your beans are defined, so you have to tell it the location.
In your test class, add the @ContextConfiguration
annotation:
@RunWith(SpringRunner.class)
@AutoConfigureTestDatabase(replace = Replace.NONE)
@DataJpaTest
@ContextConfiguration(classes = {YourBeans.class, MoreOfYourBeans.class})
public class UserRepoTest {
@Autowired
private UserRepo userRepo = null;
@Autowired
private TestEntityManager entityManager = null;
Original Author JimHawkins Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.