```java
package com.wzy.jdbctemplate.test;
import com.wzy.jdbctemplate.pojo.Book; import com.wzy.jdbctemplate.service.BookService; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.junit.Assert.*;
public class BookServiceTest {
ApplicationContext applicationContext =
new ClassPathXmlApplicationContext(“com/wzy/jdbctemplate/spring.xml”);
BookService bookService = applicationContext.getBean(“bookService”,BookService.class);
@Test
public void addBook() {
Book book = new Book(2, “bhhh”, “4654646”, “6465@163.com”);
bookService.addBook(book);
}
}
```
输出结果:


