Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Dec 19, 2023
1 parent 564803f commit 212346a
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
*/
class InstrumentedMethodTests {

private RuntimeHints hints = new RuntimeHints();
private final RuntimeHints hints = new RuntimeHints();


@Nested
class ClassReflectionInstrumentationTests {

RecordedInvocation stringGetClasses = RecordedInvocation.of(InstrumentedMethod.CLASS_GETCLASSES)
final RecordedInvocation stringGetClasses = RecordedInvocation.of(InstrumentedMethod.CLASS_GETCLASSES)
.onInstance(String.class).returnValue(String.class.getClasses()).build();

RecordedInvocation stringGetDeclaredClasses = RecordedInvocation.of(InstrumentedMethod.CLASS_GETDECLAREDCLASSES)
final RecordedInvocation stringGetDeclaredClasses = RecordedInvocation.of(InstrumentedMethod.CLASS_GETDECLAREDCLASSES)
.onInstance(String.class).returnValue(String.class.getDeclaredClasses()).build();

@Test
Expand Down Expand Up @@ -106,12 +106,12 @@ class ConstructorReflectionInstrumentationTests {

RecordedInvocation stringGetConstructor;

RecordedInvocation stringGetConstructors = RecordedInvocation.of(InstrumentedMethod.CLASS_GETCONSTRUCTORS)
final RecordedInvocation stringGetConstructors = RecordedInvocation.of(InstrumentedMethod.CLASS_GETCONSTRUCTORS)
.onInstance(String.class).returnValue(String.class.getConstructors()).build();

RecordedInvocation stringGetDeclaredConstructor;

RecordedInvocation stringGetDeclaredConstructors = RecordedInvocation.of(InstrumentedMethod.CLASS_GETDECLAREDCONSTRUCTORS)
final RecordedInvocation stringGetDeclaredConstructors = RecordedInvocation.of(InstrumentedMethod.CLASS_GETDECLAREDCONSTRUCTORS)
.onInstance(String.class).returnValue(String.class.getDeclaredConstructors()).build();

@BeforeEach
Expand Down Expand Up @@ -434,7 +434,7 @@ void classGetMethodShouldMatchInvokeMethodHint() {
}

@Test
void classGetMethodShouldNotMatchInstrospectPublicMethodsHintWhenPrivate() throws Exception {
void classGetMethodShouldNotMatchInstrospectPublicMethodsHintWhenPrivate() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_PUBLIC_METHODS);
assertThatInvocationDoesNotMatch(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetScaleMethod);
}
Expand Down Expand Up @@ -556,7 +556,7 @@ void classGetFieldShouldMatchFieldHint() {
}

@Test
void classGetFieldShouldNotMatchPublicFieldsHintWhenPrivate() throws NoSuchFieldException {
void classGetFieldShouldNotMatchPublicFieldsHintWhenPrivate() {
RecordedInvocation invocation = RecordedInvocation.of(InstrumentedMethod.CLASS_GETFIELD)
.onInstance(String.class).withArgument("value").returnValue(null).build();
hints.reflection().registerType(String.class, MemberCategory.PUBLIC_FIELDS);
Expand All @@ -572,7 +572,7 @@ void classGetFieldShouldMatchDeclaredFieldsHintWhenPrivate() throws NoSuchFieldE
}

@Test
void classGetFieldShouldNotMatchForWrongType() throws Exception {
void classGetFieldShouldNotMatchForWrongType() {
RecordedInvocation invocation = RecordedInvocation.of(InstrumentedMethod.CLASS_GETFIELD)
.onInstance(String.class).withArgument("value").returnValue(null).build();
hints.reflection().registerType(Integer.class, MemberCategory.DECLARED_FIELDS);
Expand Down

0 comments on commit 212346a

Please sign in to comment.