One common mistake that a lot Java developers take for granted that if I catch exception then the exception will be hidden for ever, that is totally false, and we should not overuse exception to manage our business workflow. This blog I will talk why should not let expected exceptions to be managed across JPA transactions.
Mockito and Powermock are most popular test frameworks in testing driven development world. In this blog, I will summary the 2 mock frameworks, and talk about some key technical fundamentals.
JPA entity is very commonly used in Hibernate involved Java applications, like Spring. Usually you can define DOs (data objects) to manage the database operations in some ORM way, but lots developers do not use the DOs property, one of the very common bad practice is the use the DOs across JPA transactions or outside JPA transactions.