All test examples are persistence layer agnostic — it means that the persistence layer can be implemented only using JDBC specification (without JPA specification)
This is the second article about Persistence Layer implementation and testing. The first article can be found here.
Also, you can find the full source code on the GitHub page.
But now let's jump right into the tests.
First of all, we will create our own annotation @PersistenceLayerTest and hide all configurations there…
In this article you will find an example of combining the two most powerful frameworks for building maintainable and type-safe persistence layer. From Spring Data JPA we will take only CRUD operations and for all complex queries we will use QueryDSL.
Here we will concentrate only on the building persistence layer. As we deal with the relational database we will rely on the JPA specification. …
In this article we will look at the problem of using the current time in the code and one of the solutions that I am fond of.
Using reference to the current date/time in the source code makes testing pretty difficult. You have to exclude such references from your assertions that sometimes is not a trivial task.
If we would like to avoid current time inconveniences during testing, time mocking is an answer. Here we will look at the example with mocking time using the new Java 8 Date/Time API (JSR 310).
For obtaining the current moment in time all…
Before explaining the reason for such a provoking story header, let me briefly tell you my personal background and attitude toward OCP certification.
I have been working with Java for more than 10 years and currently holding the OCP Java SE 8 Programmer certificate. My path to it was the following: