Spring JPA : test interface-based projection using factory
In this short article, I'll show you how you can easily test a repository method which uses interface-based projection.
Our repository:
You can use the above method this ways:
I use the
You must also provide the setters on your interface as follow:
Happy reading...
Our repository:
You can use the above method this ways:
I use the
ProjectionFactory
as well as the SpelAwareProxyProjectionFactory
for testing (spring doc).You must also provide the setters on your interface as follow:
Happy reading...
Comments
Post a Comment