Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Add missing `@FunctionalInterface` to Specification interfaces.
`SpecificationUnitTests` shouldn't be `Serializable`.

Closes #3452
  • Loading branch information
quaff authored and mp911de committed Jan 31, 2025
1 parent cd12bd5 commit aea1a03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @author Daniel Shuy
* @author Sergey Rukin
*/
@FunctionalInterface
public interface Specification<T> extends Serializable {

@Serial long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@
* @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;
Expand Down Expand Up @@ -163,7 +162,7 @@ void specificationsShouldBeSerializable() {

assertThat(specification).isNotNull();

@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "deprecation"})
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));

assertThat(transferredSpecification).isNotNull();
Expand All @@ -178,7 +177,7 @@ void complexSpecificationsShouldBeSerializable() {

assertThat(specification).isNotNull();

@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "deprecation"})
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));

assertThat(transferredSpecification).isNotNull();
Expand Down

0 comments on commit aea1a03

Please sign in to comment.