@RunWith(SpringRunner.class) @SpringBootTest @Transactional @Rollback(true) public class ShoppingCartDAOTest { @Autowired private ShoppingCartDAO shoppingCartDAO; @Test public void testSaveShoppingCart() throws Exception{ Long userAccountId = 1L; ShoppingCartDO shoppingCartDO = createShoppingCart(userAccountId); shoppingCartDAO.saveShoppingCart(shoppingCartDO); Long shoppingCartId = shoppingCartDO.getId(); assertNotNull(shoppingCartId); assertThat(shoppingCartId, greaterThan(0L)); }
}