@@ -151,15 +151,15 @@ void classGetConstructorShouldMatchInvokeDeclaredConstructorsHint() {
151151
152152 @ Test
153153 void classGetConstructorShouldMatchInstrospectConstructorHint () {
154- hints .reflection ().registerType (String .class , typeHint -> typeHint . withConstructor ( Collections . emptyList (),
155- constructorHint -> constructorHint . setModes ( ExecutableMode .INTROSPECT ) ));
154+ hints .reflection ().registerType (String .class ,typeHint ->
155+ typeHint . withConstructor ( Collections . emptyList (), ExecutableMode .INTROSPECT ));
156156 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETCONSTRUCTOR , this .stringGetConstructor );
157157 }
158158
159159 @ Test
160160 void classGetConstructorShouldMatchInvokeConstructorHint () {
161- hints .reflection ().registerType (String .class , typeHint -> typeHint . withConstructor ( Collections . emptyList (),
162- constructorHint -> constructorHint . setModes ( ExecutableMode .INVOKE ) ));
161+ hints .reflection ().registerType (String .class , typeHint ->
162+ typeHint . withConstructor ( Collections . emptyList (), ExecutableMode .INVOKE ));
163163 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETCONSTRUCTOR , this .stringGetConstructor );
164164 }
165165
@@ -201,15 +201,15 @@ void classGetDeclaredConstructorShouldNotMatchIntrospectPublicConstructorsHint()
201201
202202 @ Test
203203 void classGetDeclaredConstructorShouldMatchInstrospectConstructorHint () {
204- hints .reflection ().registerType (String .class , typeHint -> typeHint . withConstructor ( TypeReference . listOf ( byte []. class , byte . class ),
205- constructorHint -> constructorHint . setModes ( ExecutableMode .INTROSPECT ) ));
204+ hints .reflection ().registerType (String .class , typeHint ->
205+ typeHint . withConstructor ( TypeReference . listOf ( byte []. class , byte . class ), ExecutableMode .INTROSPECT ));
206206 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETDECLAREDCONSTRUCTOR , this .stringGetDeclaredConstructor );
207207 }
208208
209209 @ Test
210210 void classGetDeclaredConstructorShouldMatchInvokeConstructorHint () {
211- hints .reflection ().registerType (String .class , typeHint -> typeHint . withConstructor ( TypeReference . listOf ( byte []. class , byte . class ),
212- constructorHint -> constructorHint . setModes ( ExecutableMode .INVOKE ) ));
211+ hints .reflection ().registerType (String .class , typeHint ->
212+ typeHint . withConstructor ( TypeReference . listOf ( byte []. class , byte . class ), ExecutableMode .INVOKE ));
213213 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETDECLAREDCONSTRUCTOR , this .stringGetDeclaredConstructor );
214214 }
215215
@@ -237,7 +237,7 @@ void constructorNewInstanceShouldMatchInvokeHintOnConstructor() throws NoSuchMet
237237 RecordedInvocation invocation = RecordedInvocation .of (InstrumentedMethod .CONSTRUCTOR_NEWINSTANCE )
238238 .onInstance (String .class .getConstructor ()).returnValue ("" ).build ();
239239 hints .reflection ().registerType (String .class , typeHint ->
240- typeHint .withConstructor (Collections .emptyList (), constructorHint -> constructorHint . withMode ( ExecutableMode .INVOKE ) ));
240+ typeHint .withConstructor (Collections .emptyList (), ExecutableMode .INVOKE ));
241241 assertThatInvocationMatches (InstrumentedMethod .CONSTRUCTOR_NEWINSTANCE , invocation );
242242 }
243243
@@ -246,7 +246,7 @@ void constructorNewInstanceShouldNotMatchIntrospectHintOnConstructor() throws No
246246 RecordedInvocation invocation = RecordedInvocation .of (InstrumentedMethod .CONSTRUCTOR_NEWINSTANCE )
247247 .onInstance (String .class .getConstructor ()).returnValue ("" ).build ();
248248 hints .reflection ().registerType (String .class , typeHint ->
249- typeHint .withConstructor (Collections .emptyList (), constructorHint -> constructorHint . withMode ( ExecutableMode .INTROSPECT ) ));
249+ typeHint .withConstructor (Collections .emptyList (), ExecutableMode .INTROSPECT ));
250250 assertThatInvocationDoesNotMatch (InstrumentedMethod .CONSTRUCTOR_NEWINSTANCE , invocation );
251251 }
252252
@@ -285,15 +285,15 @@ void classGetDeclaredMethodShouldNotMatchIntrospectPublicMethodsHint() {
285285 void classGetDeclaredMethodShouldMatchIntrospectMethodHint () {
286286 List <TypeReference > parameterTypes = TypeReference .listOf (int .class , float .class );
287287 hints .reflection ().registerType (String .class , typeHint ->
288- typeHint .withMethod ("scale" , parameterTypes , methodHint -> methodHint . withMode ( ExecutableMode .INTROSPECT ) ));
288+ typeHint .withMethod ("scale" , parameterTypes , ExecutableMode .INTROSPECT ));
289289 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETDECLAREDMETHOD , this .stringGetScaleMethod );
290290 }
291291
292292 @ Test
293293 void classGetDeclaredMethodShouldMatchInvokeMethodHint () {
294294 List <TypeReference > parameterTypes = TypeReference .listOf (int .class , float .class );
295295 hints .reflection ().registerType (String .class , typeHint ->
296- typeHint .withMethod ("scale" , parameterTypes , methodHint -> methodHint . withMode ( ExecutableMode .INVOKE ) ));
296+ typeHint .withMethod ("scale" , parameterTypes , ExecutableMode .INVOKE ));
297297 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETDECLAREDMETHOD , this .stringGetScaleMethod );
298298 }
299299
@@ -378,14 +378,14 @@ void classGetMethodShouldMatchInvokeDeclaredMethodsHint() {
378378 @ Test
379379 void classGetMethodShouldMatchIntrospectMethodHint () {
380380 hints .reflection ().registerType (String .class , typeHint ->
381- typeHint .withMethod ("toString" , Collections .emptyList (), methodHint -> methodHint . setModes ( ExecutableMode .INTROSPECT ) ));
381+ typeHint .withMethod ("toString" , Collections .emptyList (), ExecutableMode .INTROSPECT ));
382382 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETMETHOD , this .stringGetToStringMethod );
383383 }
384384
385385 @ Test
386386 void classGetMethodShouldMatchInvokeMethodHint () {
387387 hints .reflection ().registerType (String .class , typeHint ->
388- typeHint .withMethod ("toString" , Collections .emptyList (), methodHint -> methodHint . setModes ( ExecutableMode .INVOKE ) ));
388+ typeHint .withMethod ("toString" , Collections .emptyList (), ExecutableMode .INVOKE ));
389389 assertThatInvocationMatches (InstrumentedMethod .CLASS_GETMETHOD , this .stringGetToStringMethod );
390390 }
391391
@@ -412,7 +412,7 @@ void methodInvokeShouldMatchInvokeHintOnMethod() throws NoSuchMethodException {
412412 RecordedInvocation invocation = RecordedInvocation .of (InstrumentedMethod .METHOD_INVOKE )
413413 .onInstance (String .class .getMethod ("startsWith" , String .class )).withArguments ("testString" , new Object [] { "test" }).build ();
414414 hints .reflection ().registerType (String .class , typeHint -> typeHint .withMethod ("startsWith" ,
415- TypeReference .listOf (String .class ), methodHint -> methodHint . withMode ( ExecutableMode .INVOKE ) ));
415+ TypeReference .listOf (String .class ), ExecutableMode .INVOKE ));
416416 assertThatInvocationMatches (InstrumentedMethod .METHOD_INVOKE , invocation );
417417 }
418418
@@ -421,7 +421,7 @@ void methodInvokeShouldNotMatchIntrospectHintOnMethod() throws NoSuchMethodExcep
421421 RecordedInvocation invocation = RecordedInvocation .of (InstrumentedMethod .METHOD_INVOKE )
422422 .onInstance (String .class .getMethod ("toString" )).withArguments ("" , new Object [0 ]).build ();
423423 hints .reflection ().registerType (String .class , typeHint ->
424- typeHint .withMethod ("toString" , Collections .emptyList (), methodHint -> methodHint . withMode ( ExecutableMode .INTROSPECT ) ));
424+ typeHint .withMethod ("toString" , Collections .emptyList (), ExecutableMode .INTROSPECT ));
425425 assertThatInvocationDoesNotMatch (InstrumentedMethod .METHOD_INVOKE , invocation );
426426 }
427427
0 commit comments