@@ -132,14 +132,14 @@ static Stream<Arguments> methodAdvicesCase() {
132
132
DynamicClassEntity emptyOperation = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "" , "" , "" );
133
133
Predicate <List <MethodInstrumentation >> emptyOperationPredicate = methodAdvices -> {
134
134
ElementMatcher <? super MethodDescription > matcher = methodAdvices .get (0 ).getMethodMatcher ();
135
- return methodAdvices .size () == 1 && matchedMethodCount (matcher , DynamicTestClass .class ) == 2 ;
135
+ return methodAdvices .size () == 1 && matchedMethodCount (matcher , DynamicTestClass .class ) == 3 ;
136
136
};
137
137
138
138
DynamicClassEntity testReturnVoidEntity = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "testReturnVoid" , "" , "" );
139
139
DynamicClassEntity testReturnVoidWithParameterEntity = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "testReturnVoidWithParameter" , "java.lang.String" , "java.lang.System.currentTimeMillis" );
140
140
Predicate <List <MethodInstrumentation >> emptyOperationAndVoidPredicate = methodAdvices -> {
141
141
ElementMatcher <? super MethodDescription > matcher = methodAdvices .get (0 ).getMethodMatcher ();
142
- return methodAdvices .size () == 1 && matchedMethodCount (matcher , DynamicTestClass .class ) == 0 ;
142
+ return methodAdvices .size () == 1 && matchedMethodCount (matcher , DynamicTestClass .class ) == 1 ;
143
143
};
144
144
145
145
DynamicClassEntity testReturnNonPrimitiveTypeWithParameterEntity = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "testReturnNonPrimitiveTypeWithParameter" , "java.lang.String" , null );
@@ -150,17 +150,21 @@ static Stream<Arguments> methodAdvicesCase() {
150
150
};
151
151
152
152
DynamicClassEntity testReturnWithParameterWildcard = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "*WithParameter*,testReturnVoid*,*WithParameter" , "" , null );
153
+ Predicate <List <MethodInstrumentation >> operationWithParameterWildcardPredicate = methodAdvices -> {
154
+ ElementMatcher <? super MethodDescription > matcher = methodAdvices .get (0 ).getMethodMatcher ();
155
+ return methodAdvices .size () == 1 && matchedMethodCount (matcher , DynamicTestClass .class ) == 4 ;
156
+ };
153
157
154
158
final DynamicClassEntity testReturnNonPrimitiveType = new DynamicClassEntity (
155
159
"io.arex.inst.dynamic.DynamicTestClass" , "testReturnNonPrimitiveType" , "" ,
156
160
ArexConstants .UUID_SIGNATURE );
157
161
Predicate <List <MethodInstrumentation >> emptyListPredicate = List ::isEmpty ;
158
162
159
163
return Stream .of (
160
- arguments ("should_match_2_methods_when_empty_operation " , Collections .singletonList (emptyOperation ), NOT_EMPTY_PREDICATE .and (emptyOperationPredicate )),
161
- arguments ("should_match_0_method_when_with_return_void " , Arrays .asList (testReturnVoidEntity , testReturnVoidWithParameterEntity ), NOT_EMPTY_PREDICATE .and (emptyOperationAndVoidPredicate )),
164
+ arguments ("should_match_3_methods_when_empty_operation " , Collections .singletonList (emptyOperation ), NOT_EMPTY_PREDICATE .and (emptyOperationPredicate )),
165
+ arguments ("should_match_1_method_when_with_return_void " , Arrays .asList (testReturnVoidEntity , testReturnVoidWithParameterEntity ), NOT_EMPTY_PREDICATE .and (emptyOperationAndVoidPredicate )),
162
166
arguments ("should_match_2_method_when_with_parameter" , Arrays .asList (testReturnNonPrimitiveTypeWithParameterEntity , testReturnPrimitiveTypeWithParameter ), NOT_EMPTY_PREDICATE .and (operationWithParameterPredicate )),
163
- arguments ("should_match_2_method_when_with_parameter_wildcard " , Arrays .asList (testReturnWithParameterWildcard ), NOT_EMPTY_PREDICATE .and (operationWithParameterPredicate )),
167
+ arguments ("should_match_4_method_when_with_parameter_wildcard " , Arrays .asList (testReturnWithParameterWildcard ), NOT_EMPTY_PREDICATE .and (operationWithParameterWildcardPredicate )),
164
168
arguments ("should_match_0_method_when_with_replace_uuid" , Collections .singletonList (testReturnNonPrimitiveType ), emptyListPredicate )
165
169
);
166
170
}
0 commit comments