40
40
*/
41
41
class InstrumentedMethodTests {
42
42
43
- private RuntimeHints hints = new RuntimeHints ();
43
+ private final RuntimeHints hints = new RuntimeHints ();
44
44
45
45
46
46
@ Nested
47
47
class ClassReflectionInstrumentationTests {
48
48
49
- RecordedInvocation stringGetClasses = RecordedInvocation .of (InstrumentedMethod .CLASS_GETCLASSES )
49
+ final RecordedInvocation stringGetClasses = RecordedInvocation .of (InstrumentedMethod .CLASS_GETCLASSES )
50
50
.onInstance (String .class ).returnValue (String .class .getClasses ()).build ();
51
51
52
- RecordedInvocation stringGetDeclaredClasses = RecordedInvocation .of (InstrumentedMethod .CLASS_GETDECLAREDCLASSES )
52
+ final RecordedInvocation stringGetDeclaredClasses = RecordedInvocation .of (InstrumentedMethod .CLASS_GETDECLAREDCLASSES )
53
53
.onInstance (String .class ).returnValue (String .class .getDeclaredClasses ()).build ();
54
54
55
55
@ Test
@@ -106,12 +106,12 @@ class ConstructorReflectionInstrumentationTests {
106
106
107
107
RecordedInvocation stringGetConstructor ;
108
108
109
- RecordedInvocation stringGetConstructors = RecordedInvocation .of (InstrumentedMethod .CLASS_GETCONSTRUCTORS )
109
+ final RecordedInvocation stringGetConstructors = RecordedInvocation .of (InstrumentedMethod .CLASS_GETCONSTRUCTORS )
110
110
.onInstance (String .class ).returnValue (String .class .getConstructors ()).build ();
111
111
112
112
RecordedInvocation stringGetDeclaredConstructor ;
113
113
114
- RecordedInvocation stringGetDeclaredConstructors = RecordedInvocation .of (InstrumentedMethod .CLASS_GETDECLAREDCONSTRUCTORS )
114
+ final RecordedInvocation stringGetDeclaredConstructors = RecordedInvocation .of (InstrumentedMethod .CLASS_GETDECLAREDCONSTRUCTORS )
115
115
.onInstance (String .class ).returnValue (String .class .getDeclaredConstructors ()).build ();
116
116
117
117
@ BeforeEach
@@ -434,7 +434,7 @@ void classGetMethodShouldMatchInvokeMethodHint() {
434
434
}
435
435
436
436
@ Test
437
- void classGetMethodShouldNotMatchInstrospectPublicMethodsHintWhenPrivate () throws Exception {
437
+ void classGetMethodShouldNotMatchInstrospectPublicMethodsHintWhenPrivate () {
438
438
hints .reflection ().registerType (String .class , MemberCategory .INTROSPECT_PUBLIC_METHODS );
439
439
assertThatInvocationDoesNotMatch (InstrumentedMethod .CLASS_GETMETHOD , this .stringGetScaleMethod );
440
440
}
@@ -556,7 +556,7 @@ void classGetFieldShouldMatchFieldHint() {
556
556
}
557
557
558
558
@ Test
559
- void classGetFieldShouldNotMatchPublicFieldsHintWhenPrivate () throws NoSuchFieldException {
559
+ void classGetFieldShouldNotMatchPublicFieldsHintWhenPrivate () {
560
560
RecordedInvocation invocation = RecordedInvocation .of (InstrumentedMethod .CLASS_GETFIELD )
561
561
.onInstance (String .class ).withArgument ("value" ).returnValue (null ).build ();
562
562
hints .reflection ().registerType (String .class , MemberCategory .PUBLIC_FIELDS );
@@ -572,7 +572,7 @@ void classGetFieldShouldMatchDeclaredFieldsHintWhenPrivate() throws NoSuchFieldE
572
572
}
573
573
574
574
@ Test
575
- void classGetFieldShouldNotMatchForWrongType () throws Exception {
575
+ void classGetFieldShouldNotMatchForWrongType () {
576
576
RecordedInvocation invocation = RecordedInvocation .of (InstrumentedMethod .CLASS_GETFIELD )
577
577
.onInstance (String .class ).withArgument ("value" ).returnValue (null ).build ();
578
578
hints .reflection ().registerType (Integer .class , MemberCategory .DECLARED_FIELDS );
0 commit comments