434445464748495051525354
session = sessionFactory.openSession(); tx = session.beginTransaction(); // fill with test data Book book = new Book(); book.setName("The Lord of the Rings"); session.save(book); tx.commit(); logger.info("Data has been initialised successfully");
3334353637383940
assertEquals(1, books.size()); } @Test public void getBook() throws Exception { Book book = bookStoreService.getBook(1); assertEquals("The Lord of the Rings", book.getName()); }