11package it .aboutbits .springboot .testing .validation .core ;
22
3+ import com .google .errorprone .annotations .CheckReturnValue ;
34import it .aboutbits .springboot .toolbox .type .CustomType ;
45import jakarta .validation .Valid ;
56import lombok .AccessLevel ;
@@ -49,13 +50,15 @@ public static void registerNonBeanType(Class<?> type) {
4950 NON_BEAN_TYPES .add (type );
5051 }
5152
53+ @ CheckReturnValue
5254 public <P > CallBuilder <R , P > of (P parameterUnderTest ) {
5355 this .parameterUnderTest = parameterUnderTest ;
5456 ruleBuilder .setTriggerValidation (this ::assertValidation );
5557 return new CallBuilder <>(this );
5658 }
5759
5860 @ SuppressWarnings ("unused" )
61+ @ CheckReturnValue
5962 public AnnotationChecker calling (
6063 Class <?> classUnderTest ,
6164 String methodName ,
@@ -97,17 +100,20 @@ public static final class CallBuilder<R extends BaseRuleBuilder<?>, P> {
97100 private final BaseValidationAssert <R > parent ;
98101
99102 @ SuppressWarnings ("unused" )
103+ @ CheckReturnValue
100104 public R calling (Consumer <P > functionToCallWithParameter ) {
101105 parent .setFunctionToCallWithParameter (functionToCallWithParameter );
102106 return parent .ruleBuilder ;
103107 }
104108
105109 @ SuppressWarnings ("unused" )
110+ @ CheckReturnValue
106111 public R usingBeanValidation () {
107112 return parent .ruleBuilder ;
108113 }
109114
110115 @ SuppressWarnings ({"unused" , "unchecked" })
116+ @ CheckReturnValue
111117 public <ID > R calling (
112118 BiConsumer <ID , P > functionToCallWithParameter ,
113119 ID id
@@ -119,6 +125,7 @@ public <ID> R calling(
119125 }
120126
121127 @ SuppressWarnings ({"unused" , "unchecked" })
128+ @ CheckReturnValue
122129 public <A , B > R calling (
123130 TriConsumer <A , B , P > functionToCallWithParameter ,
124131 A a ,
0 commit comments