I have a builder that create a JPA Specification according to filters. How do I test the builder ? assertEquals
method always return false when comparing Specifications...
I already try to call Specification::toPredicate
method with mock args but the returned value is null
. I would like to avoid loading the entityManager
.
Specification<MyClass> nullSpecification = Specification.where(null);
Specification<MyClass> nullSpecification2 = Specification.where(null);
assertEquals(nullSpecification, nullSpecification2);
I expected assertEquals(nullSpecification, nullSpecification2)
to return true but the actual value is false. How can I compare JPA Specification ?