Skip to content

Commit a0944b0

Browse files
snicollphilwebb
andcommitted
Migrate to updated native hints API and new reachability JSON
Replace hint API calls with updated version and fix tests that relied on previous JSON files. See gh-45487 Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
1 parent 5ea0674 commit a0944b0

File tree

43 files changed

+119
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+119
-150
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void shouldRegisterHints() {
3838
RuntimeHints runtimeHints = new RuntimeHints();
3939
new CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints().registerHints(runtimeHints,
4040
getClass().getClassLoader());
41-
assertThat(RuntimeHintsPredicates.reflection().onMethod(CloudFoundryLinksHandler.class, "links").invoke())
41+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(CloudFoundryLinksHandler.class, "links"))
4242
.accepts(runtimeHints);
4343
assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints);
4444
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMappingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void shouldRegisterHints() {
3838
RuntimeHints runtimeHints = new RuntimeHints();
3939
new CloudFoundryWebEndpointServletHandlerMappingRuntimeHints().registerHints(runtimeHints,
4040
getClass().getClassLoader());
41-
assertThat(RuntimeHintsPredicates.reflection().onMethod(CloudFoundryLinksHandler.class, "links").invoke())
41+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(CloudFoundryLinksHandler.class, "links"))
4242
.accepts(runtimeHints);
4343
assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints);
4444
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/ServiceLevelObjectiveBoundaryTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ void shouldRegisterRuntimeHints() {
8484
getClass().getClassLoader());
8585
ReflectionUtils.doWithLocalMethods(ServiceLevelObjectiveBoundary.class, (method) -> {
8686
if ("valueOf".equals(method.getName())) {
87-
assertThat(RuntimeHintsPredicates.reflection().onMethod(method)).accepts(runtimeHints);
87+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(method)).accepts(runtimeHints);
8888
}
8989
});
9090
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/OperationReflectiveProcessorTests.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ class OperationReflectiveProcessorTests {
4747
void shouldRegisterMethodAsInvokable() {
4848
Method method = ReflectionUtils.findMethod(Methods.class, "string");
4949
runProcessor(method);
50-
assertThat(RuntimeHintsPredicates.reflection().onMethod(method)).accepts(this.runtimeHints);
50+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(method)).accepts(this.runtimeHints);
5151
}
5252

5353
@Test
@@ -82,12 +82,10 @@ void shouldNotRegisterResourceReturnType() {
8282
private void assertHintsForDto() {
8383
assertThat(RuntimeHintsPredicates.reflection()
8484
.onType(Dto.class)
85-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
86-
.accepts(this.runtimeHints);
85+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(this.runtimeHints);
8786
assertThat(RuntimeHintsPredicates.reflection()
8887
.onType(NestedDto.class)
89-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
90-
.accepts(this.runtimeHints);
88+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(this.runtimeHints);
9189
}
9290

9391
private void runProcessor(Method method) {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMappingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WebFluxEndpointHandlerMappingTests {
3737
void shouldRegisterHints() {
3838
RuntimeHints runtimeHints = new RuntimeHints();
3939
new WebFluxEndpointHandlerMappingRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
40-
assertThat(RuntimeHintsPredicates.reflection().onMethod(WebFluxLinksHandler.class, "links").invoke())
40+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(WebFluxLinksHandler.class, "links"))
4141
.accepts(runtimeHints);
4242
assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints);
4343
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMappingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WebMvcEndpointHandlerMappingTests {
3737
void shouldRegisterHints() {
3838
RuntimeHints runtimeHints = new RuntimeHints();
3939
new WebMvcEndpointHandlerMappingRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
40-
assertThat(RuntimeHintsPredicates.reflection().onMethod(WebMvcLinksHandler.class, "links").invoke())
40+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(WebMvcLinksHandler.class, "links"))
4141
.accepts(runtimeHints);
4242
assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints);
4343
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointWebExtensionRuntimeHintsTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,8 +41,7 @@ void shouldRegisterHints() {
4141
for (Class<?> bindingType : bindingTypes) {
4242
assertThat(RuntimeHintsPredicates.reflection()
4343
.onType(bindingType)
44-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
45-
.accepts(runtimeHints);
44+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
4645
}
4746
}
4847

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/info/BuildInfoContributorTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,8 +39,7 @@ void shouldRegisterHints() {
3939
new BuildInfoContributorRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
4040
assertThat(RuntimeHintsPredicates.reflection()
4141
.onType(BuildProperties.class)
42-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
43-
.accepts(runtimeHints);
42+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
4443
}
4544

4645
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/info/GitInfoContributorTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -90,8 +90,7 @@ void shouldRegisterHints() {
9090
new GitInfoContributorRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
9191
assertThat(RuntimeHintsPredicates.reflection()
9292
.onType(GitProperties.class)
93-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
94-
.accepts(runtimeHints);
93+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
9594

9695
}
9796

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/info/JavaInfoContributorTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,8 +49,7 @@ void shouldRegisterHints() {
4949
new JavaInfoContributorRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
5050
assertThat(RuntimeHintsPredicates.reflection()
5151
.onType(JavaInfo.class)
52-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
53-
.accepts(runtimeHints);
52+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
5453
}
5554

5655
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/info/OsInfoContributorTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,8 +49,7 @@ void shouldRegisterHints() {
4949
new OsInfoContributorRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
5050
assertThat(RuntimeHintsPredicates.reflection()
5151
.onType(OsInfo.class)
52-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
53-
.accepts(runtimeHints);
52+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
5453
}
5554

5655
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/info/ProcessInfoContributorTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ void shouldRegisterHints() {
5252
new ProcessInfoContributorRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
5353
assertThat(RuntimeHintsPredicates.reflection()
5454
.onType(ProcessInfo.class)
55-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
56-
.accepts(runtimeHints);
55+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
5756
}
5857

5958
@Test

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/info/SslInfoContributorTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,8 +56,7 @@ void shouldRegisterHints() {
5656
new SslInfoContributorRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
5757
assertThat(RuntimeHintsPredicates.reflection()
5858
.onType(SslInfo.class)
59-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
60-
.accepts(runtimeHints);
59+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
6160
}
6261

6362
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LoggersEndpointTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,17 @@ void registersRuntimeHintsForClassesSerializedToJson() {
164164
new ReflectiveRuntimeHintsRegistrar().registerRuntimeHints(runtimeHints, LoggersEndpoint.class);
165165
ReflectionHintsPredicates reflection = RuntimeHintsPredicates.reflection();
166166
assertThat(reflection.onType(LoggerLevelsDescriptor.class)).accepts(runtimeHints);
167-
assertThat(reflection.onMethod(LoggerLevelsDescriptor.class, "getConfiguredLevel").invoke())
167+
assertThat(reflection.onMethodInvocation(LoggerLevelsDescriptor.class, "getConfiguredLevel"))
168168
.accepts(runtimeHints);
169169
assertThat(reflection.onType(SingleLoggerLevelsDescriptor.class)).accepts(runtimeHints);
170-
assertThat(reflection.onMethod(SingleLoggerLevelsDescriptor.class, "getEffectiveLevel").invoke())
170+
assertThat(reflection.onMethodInvocation(SingleLoggerLevelsDescriptor.class, "getEffectiveLevel"))
171171
.accepts(runtimeHints);
172-
assertThat(reflection.onMethod(SingleLoggerLevelsDescriptor.class, "getConfiguredLevel").invoke())
172+
assertThat(reflection.onMethodInvocation(SingleLoggerLevelsDescriptor.class, "getConfiguredLevel"))
173173
.accepts(runtimeHints);
174174
assertThat(reflection.onType(GroupLoggerLevelsDescriptor.class)).accepts(runtimeHints);
175-
assertThat(reflection.onMethod(GroupLoggerLevelsDescriptor.class, "getMembers").invoke()).accepts(runtimeHints);
176-
assertThat(reflection.onMethod(GroupLoggerLevelsDescriptor.class, "getConfiguredLevel").invoke())
175+
assertThat(reflection.onMethodInvocation(GroupLoggerLevelsDescriptor.class, "getMembers"))
176+
.accepts(runtimeHints);
177+
assertThat(reflection.onMethodInvocation(GroupLoggerLevelsDescriptor.class, "getConfiguredLevel"))
177178
.accepts(runtimeHints);
178179
}
179180

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/HazelcastCacheMeterBinderProviderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void hazelcastCacheProvider() {
5555
void shouldRegisterHints() {
5656
RuntimeHints runtimeHints = new RuntimeHints();
5757
new HazelcastCacheMeterBinderProviderRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
58-
assertThat(RuntimeHintsPredicates.reflection().onMethod(HazelcastCache.class, "getNativeCache").invoke())
58+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(HazelcastCache.class, "getNativeCache"))
5959
.accepts(runtimeHints);
6060
assertThat(RuntimeHintsPredicates.reflection().onType(HazelcastCacheMetrics.class)).accepts(runtimeHints);
6161
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/quartz/QuartzEndpointWebExtensionTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -105,8 +105,7 @@ void shouldRegisterHints() {
105105
for (Class<?> bindingType : bindingTypes) {
106106
assertThat(RuntimeHintsPredicates.reflection()
107107
.onType(bindingType)
108-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
109-
.accepts(runtimeHints);
108+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
110109
}
111110
}
112111

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/scheduling/ScheduledTasksEndpointTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -206,8 +206,7 @@ void shouldRegisterHints() {
206206
for (Class<?> bindingType : bindingTypes) {
207207
assertThat(RuntimeHintsPredicates.reflection()
208208
.onType(bindingType)
209-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
210-
.accepts(runtimeHints);
209+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
211210
}
212211
}
213212

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/reactive/DispatcherHandlersMappingDescriptionProviderTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,8 +39,7 @@ void shouldRegisterHints() {
3939
getClass().getClassLoader());
4040
assertThat(RuntimeHintsPredicates.reflection()
4141
.onType(DispatcherHandlerMappingDescription.class)
42-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
43-
.accepts(runtimeHints);
42+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
4443
}
4544

4645
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProviderTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,8 +39,7 @@ void shouldRegisterHints() {
3939
getClass().getClassLoader());
4040
assertThat(RuntimeHintsPredicates.reflection()
4141
.onType(DispatcherServletMappingDescription.class)
42-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
43-
.accepts(runtimeHints);
42+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
4443
}
4544

4645
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProviderTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,8 +38,7 @@ void shouldRegisterHints() {
3838
new FiltersMappingDescriptionProviderRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
3939
assertThat(RuntimeHintsPredicates.reflection()
4040
.onType(FilterRegistrationMappingDescription.class)
41-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
42-
.accepts(runtimeHints);
41+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
4342
}
4443

4544
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProviderTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,8 +38,7 @@ void shouldRegisterHints() {
3838
new ServletsMappingDescriptionProviderRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
3939
assertThat(RuntimeHintsPredicates.reflection()
4040
.onType(ServletRegistrationMappingDescription.class)
41-
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS))
42-
.accepts(runtimeHints);
41+
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);
4342
}
4443

4544
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static class GraphQlResourcesRuntimeHints implements RuntimeHintsRegistrar {
205205

206206
@Override
207207
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
208-
hints.resources().registerPattern("graphql/*.graphqls").registerPattern("graphql/*.gqls");
208+
hints.resources().registerPattern("graphql/**/*.graphqls").registerPattern("graphql/**/*.gqls");
209209
}
210210

211211
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static class LiquibaseAutoConfigurationRuntimeHints implements RuntimeHintsRegis
227227

228228
@Override
229229
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
230-
hints.resources().registerPattern("db/changelog/*");
230+
hints.resources().registerPattern("db/changelog/**");
231231
}
232232

233233
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateRuntimeHints.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ class TemplateRuntimeHints implements RuntimeHintsRegistrar {
2828

2929
@Override
3030
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
31-
hints.resources().registerPatternIfPresent(classLoader, "templates", (hint) -> hint.includes("templates/*"));
31+
hints.resources().registerPatternIfPresent(classLoader, "templates", (hint) -> hint.includes("templates/**"));
3232
}
3333

3434
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,12 @@ void shouldRegisterHints() {
335335
RuntimeHints hints = new RuntimeHints();
336336
new HttpMessageConvertersAutoConfigurationRuntimeHints().registerHints(hints, getClass().getClassLoader());
337337
assertThat(RuntimeHintsPredicates.reflection().onType(Encoding.class)).accepts(hints);
338-
assertThat(RuntimeHintsPredicates.reflection().onMethod(Encoding.class, "getCharset").invoke()).accepts(hints);
339-
assertThat(RuntimeHintsPredicates.reflection().onMethod(Encoding.class, "setCharset").invoke()).accepts(hints);
340-
assertThat(RuntimeHintsPredicates.reflection().onMethod(Encoding.class, "isForce").invoke()).accepts(hints);
341-
assertThat(RuntimeHintsPredicates.reflection().onMethod(Encoding.class, "setForce").invoke()).accepts(hints);
342-
assertThat(RuntimeHintsPredicates.reflection().onMethod(Encoding.class, "shouldForce")).rejects(hints);
338+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(Encoding.class, "getCharset")).accepts(hints);
339+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(Encoding.class, "setCharset")).accepts(hints);
340+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(Encoding.class, "isForce")).accepts(hints);
341+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(Encoding.class, "setForce")).accepts(hints);
342+
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(Encoding.class, "shouldForce"))
343+
.rejects(hints);
343344
}
344345

345346
private ApplicationContextRunner allOptionsRunner() {

0 commit comments

Comments
 (0)