Skip to content

Commit b6974ff

Browse files
committed
Make MissingParameterNamesFailureAnalyzerTests more robust
Explicitly nullify `ParameterNameDiscovery` to simulate code that has not been compiled with `-parameters`. Previously we were relying on an initialization behavior that could change and break those tests.
1 parent 8e895b3 commit b6974ff

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/MissingParameterNamesFailureAnalyzerTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ private RuntimeException getSpringFrameworkMissingParameterException() throws Ex
9494
MockResolver resolver = new MockResolver();
9595
Method method = getClass().getDeclaredMethod("example", String.class);
9696
MethodParameter parameter = new MethodParameter(method, 0);
97+
parameter.initParameterNameDiscovery(null);
9798
try {
9899
resolver.resolveArgument(parameter, null, mock(NativeWebRequest.class), null);
99100
}

0 commit comments

Comments
 (0)