Polishing.
Add missing `@FunctionalInterface` to Specification interfaces. `SpecificationUnitTests` shouldn't be `Serializable`. Closes #3452
This commit is contained in:
committed by
Mark Paluch
parent
cd12bd5693
commit
aea1a03b9f
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user