测试确实是异常捕获的问题。控制台报的问题:
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@16bcca2e]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7fd3d068] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@1897148898 wrapping com.mysql.cj.jdbc.ConnectionImpl@7e52a02a] will not be managed by Spring
==> Preparing: select id, category_id, name, subtitle, main_image, sub_images, detail, price, stock, status, create_time, update_time from mall_product where id = ?
==> Parameters: 26(Integer)
<== Total: 0
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7fd3d068]
问题这个又不是RuntimeException为什么会被捕获,好奇怪。。