MethodInvocationRecorder now supports traversing primitive properties.
We now return a default value for invocations of methods returning a primitive value to pass the AOP infrastructure's check for compatible values. Before, that barked at the null value returned for the invocation. Fixes #2612.
This commit is contained in:
@@ -86,6 +86,14 @@ class MethodInvocationRecorderUnitTests {
|
||||
assertThat(recorder.record(Sample::getName).getPropertyPath()).hasValue("name");
|
||||
}
|
||||
|
||||
@Test // #2612
|
||||
void registersLookupForPrimitiveValue() {
|
||||
|
||||
var recorder = MethodInvocationRecorder.forProxyOf(Foo.class);
|
||||
|
||||
assertThat(recorder.record(Foo::getAge).getPropertyPath()).hasValue("age");
|
||||
}
|
||||
|
||||
static final class FinalType {}
|
||||
|
||||
@Getter
|
||||
@@ -93,6 +101,7 @@ class MethodInvocationRecorderUnitTests {
|
||||
Bar bar;
|
||||
Collection<Bar> bars;
|
||||
String name;
|
||||
int age;
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
Reference in New Issue
Block a user