Polishing.

Add missing `@FunctionalInterface` to Specification interfaces.
`SpecificationUnitTests` shouldn't be `Serializable`.

Closes #3452
This commit is contained in:
Yanming Zhou
2024-04-28 09:36:37 +08:00
committed by Mark Paluch
parent cd12bd5693
commit aea1a03b9f
2 changed files with 4 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ import org.springframework.lang.Nullable;
* @author Daniel Shuy
* @author Sergey Rukin
*/
@FunctionalInterface
public interface Specification<T> extends Serializable {
@Serial long serialVersionUID = 1L;

View File

@@ -46,10 +46,9 @@ import org.mockito.quality.Strictness;
* @author Mark Paluch
* @author Daniel Shuy
*/
@SuppressWarnings("serial")
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
class SpecificationUnitTests implements Serializable {
class SpecificationUnitTests {
private Specification<Object> spec;
@Mock(serializable = true) Root<Object> root;
@@ -163,7 +162,7 @@ class SpecificationUnitTests implements Serializable {
assertThat(specification).isNotNull();
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "deprecation"})
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));
assertThat(transferredSpecification).isNotNull();
@@ -178,7 +177,7 @@ class SpecificationUnitTests implements Serializable {
assertThat(specification).isNotNull();
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "deprecation"})
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));
assertThat(transferredSpecification).isNotNull();