From 212346a86d4e7e1cac8fa8e1a31419d901b5fdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 19 Dec 2023 19:48:42 +0100 Subject: [PATCH] Polish --- .../aot/agent/InstrumentedMethodTests.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java b/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java index 929ba113f3f0..733c368c699a 100644 --- a/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java +++ b/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java @@ -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 @@ -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 @@ -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); } @@ -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); @@ -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);