@@ -132,14 +132,14 @@ static Stream<Arguments> methodAdvicesCase() {
132132 DynamicClassEntity emptyOperation = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "" , "" , "" );
133133 Predicate <List <MethodInstrumentation >> emptyOperationPredicate = methodAdvices -> {
134134 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 ;
136136 };
137137
138138 DynamicClassEntity testReturnVoidEntity = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "testReturnVoid" , "" , "" );
139139 DynamicClassEntity testReturnVoidWithParameterEntity = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "testReturnVoidWithParameter" , "java.lang.String" , "java.lang.System.currentTimeMillis" );
140140 Predicate <List <MethodInstrumentation >> emptyOperationAndVoidPredicate = methodAdvices -> {
141141 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 ;
143143 };
144144
145145 DynamicClassEntity testReturnNonPrimitiveTypeWithParameterEntity = new DynamicClassEntity ("io.arex.inst.dynamic.DynamicTestClass" , "testReturnNonPrimitiveTypeWithParameter" , "java.lang.String" , null );
@@ -150,17 +150,21 @@ static Stream<Arguments> methodAdvicesCase() {
150150 };
151151
152152 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+ };
153157
154158 final DynamicClassEntity testReturnNonPrimitiveType = new DynamicClassEntity (
155159 "io.arex.inst.dynamic.DynamicTestClass" , "testReturnNonPrimitiveType" , "" ,
156160 ArexConstants .UUID_SIGNATURE );
157161 Predicate <List <MethodInstrumentation >> emptyListPredicate = List ::isEmpty ;
158162
159163 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 )),
162166 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 )),
164168 arguments ("should_match_0_method_when_with_replace_uuid" , Collections .singletonList (testReturnNonPrimitiveType ), emptyListPredicate )
165169 );
166170 }
0 commit comments