**@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(
classes = Application.class,
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT
)
@DirtiesContext
public class dataOpTest {
private TBookController tBookController = new TBookController();
public TBookMapper tBookMapper;
@Test
public void testIfExistByName(){
String bk_name = "c++";
//int existCount = tBookController.ifExist(bk_name);
int result = tBookMapper.existByNameAndState(bk_name);
Assert.assertEquals(result, 1);
}
}**
以上代码,会认为tBookController是空指针,它本身是一个接口,sql实现都在xml文件里面,但是集成测试的时候怎么做?