I'm putting together a small unit test in a spring boot app.
spring-boot: 2.6.1
mybatis-starter:2.2.0
Junit 5: 5.8.0
Im not having any luck getting the test to work. If I add a @SpringBootApplication as noted in the link I provided I get
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type error
If I remove the @SpringBootApplication I get:
Neither @ContextConfiguration nor @ContextHierarchy found for test class [fehrm.servicelayer.mapper.EnqueueStatusDaoTest], using SpringBootContextLoader
Here is my Test class: Im using H2 for the db..
@MybatisTest
@ActiveProfiles("test")
@Import(EnqueueStatusDao.class)
public class EnqueueStatusDaoTest {
@Autowired
private EnqueueStatusDao enqueueStatusDao;
@Test
public void testSelect()
{
EnqueueStatus es = enqueueStatusDao.selectEnqueuePatient("1000000050");
Assertions.assertNotNull(es);
}