demo如下:
public class ControllerTest {
@Autowired
TestService testService ;
//2 建一个静态的本类
private static ControllerTest controllerTest ;
public ControllerTest () {
controllerTest = this;
controllerTest.testService = this.testService ;
}
@AfterClass
public static void doAfter() {
ControllerTest.testService.deleteByPrimaryKey(ID);
}
}