56 changed files with 386 additions and 938 deletions
7
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/aot/ActuatorAnnotationsRuntimeHintsRegistrar.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ActuatorAnnotationsRuntimeHints.java
7
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/aot/ActuatorAnnotationsRuntimeHintsRegistrar.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ActuatorAnnotationsRuntimeHints.java
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.cloudfoundry; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.autoconfigure.cloudfoundry.CloudFoundryWebEndpointDiscoverer.CloudFoundryWebEndpointDiscovererRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link CloudFoundryWebEndpointDiscovererRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class CloudFoundryWebEndpointDiscovererRuntimeHintsTests { |
||||
|
||||
private final CloudFoundryWebEndpointDiscovererRuntimeHints sut = new CloudFoundryWebEndpointDiscovererRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(CloudFoundryEndpointFilter.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints); |
||||
} |
||||
|
||||
} |
||||
9
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingTests.java
9
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingTests.java
9
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMappingTests.java
9
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMappingTests.java
10
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/aot/ActuatorAnnotationsRuntimeHintsRegistrarTests.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ActuatorAnnotationsRuntimeHintsTests.java
10
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/aot/ActuatorAnnotationsRuntimeHintsRegistrarTests.java → spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ActuatorAnnotationsRuntimeHintsTests.java
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
/** |
||||
* Support classes for actuator in AOT mode. |
||||
*/ |
||||
package org.springframework.boot.actuate.aot; |
||||
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.endpoint.jmx.annotation; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.endpoint.jmx.annotation.JmxEndpointDiscoverer.JmxEndpointDiscovererRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link JmxEndpointDiscovererRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class JmxEndpointDiscovererRuntimeHintsTests { |
||||
|
||||
private final JmxEndpointDiscovererRuntimeHints sut = new JmxEndpointDiscovererRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(JmxEndpointFilter.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints); |
||||
} |
||||
|
||||
} |
||||
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.endpoint.web.annotation; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointDiscoverer.ControllerEndpointDiscovererRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link ControllerEndpointDiscovererRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class ControllerEndpointDiscovererRuntimeHintsTests { |
||||
|
||||
private final ControllerEndpointDiscovererRuntimeHints sut = new ControllerEndpointDiscovererRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(ControllerEndpointFilter.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints); |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.endpoint.web.annotation; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer.ServletEndpointDiscovererRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link ServletEndpointDiscovererRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class ServletEndpointDiscovererRuntimeHintsTests { |
||||
|
||||
private final ServletEndpointDiscovererRuntimeHints sut = new ServletEndpointDiscovererRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(ServletEndpointFilter.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints); |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.endpoint.web.annotation; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer.WebEndpointDiscovererRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link WebEndpointDiscovererRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class WebEndpointDiscovererRuntimeHintsTests { |
||||
|
||||
private final WebEndpointDiscovererRuntimeHints sut = new WebEndpointDiscovererRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(WebEndpointFilter.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints); |
||||
|
||||
} |
||||
|
||||
} |
||||
9
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingTests.java
9
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMappingTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMappingTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMappingTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMappingRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMappingTests.java
@ -1,51 +0,0 @@
@@ -1,51 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.health; |
||||
|
||||
import java.util.Set; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.health.HealthEndpointWebExtension.HealthEndpointWebExtensionRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link HealthEndpointWebExtensionRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class HealthEndpointWebExtensionRuntimeHintsTests { |
||||
|
||||
private final HealthEndpointWebExtensionRuntimeHints sut = new HealthEndpointWebExtensionRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
Set<Class<?>> bindingTypes = Set.of(Health.class, SystemHealth.class, CompositeHealth.class); |
||||
for (Class<?> bindingType : bindingTypes) { |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(bindingType) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS)) |
||||
.accepts(runtimeHints); |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,48 +0,0 @@
@@ -1,48 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.info; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.info.GitInfoContributor.GitInfoContributorRuntimeHints; |
||||
import org.springframework.boot.info.GitProperties; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests forr {@link GitInfoContributorRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class GitInfoContributorRuntimeHintsTests { |
||||
|
||||
private final GitInfoContributorRuntimeHints sut = new GitInfoContributorRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(GitProperties.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS)) |
||||
.accepts(runtimeHints); |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.info; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.info.JavaInfoContributor.JavaInfoContributorRuntimeHints; |
||||
import org.springframework.boot.info.JavaInfo; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link JavaInfoContributorRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class JavaInfoContributorRuntimeHintsTests { |
||||
|
||||
private final JavaInfoContributorRuntimeHints sut = new JavaInfoContributorRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(JavaInfo.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS)) |
||||
.accepts(runtimeHints); |
||||
} |
||||
|
||||
} |
||||
@ -1,48 +0,0 @@
@@ -1,48 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.info; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.info.OsInfoContributor.OsInfoContributorRuntimeHints; |
||||
import org.springframework.boot.info.OsInfo; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link OsInfoContributorRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class OsInfoContributorRuntimeHintsTests { |
||||
|
||||
private final OsInfoContributorRuntimeHints sut = new OsInfoContributorRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(OsInfo.class) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS)) |
||||
.accepts(runtimeHints); |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -1,72 +0,0 @@
@@ -1,72 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.integration; |
||||
|
||||
import java.util.Set; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint.IntegrationGraphEndpointRuntimeHints; |
||||
import org.springframework.integration.graph.CompositeMessageHandlerNode; |
||||
import org.springframework.integration.graph.DiscardingMessageHandlerNode; |
||||
import org.springframework.integration.graph.EndpointNode; |
||||
import org.springframework.integration.graph.ErrorCapableCompositeMessageHandlerNode; |
||||
import org.springframework.integration.graph.ErrorCapableDiscardingMessageHandlerNode; |
||||
import org.springframework.integration.graph.ErrorCapableEndpointNode; |
||||
import org.springframework.integration.graph.ErrorCapableMessageHandlerNode; |
||||
import org.springframework.integration.graph.ErrorCapableRoutingNode; |
||||
import org.springframework.integration.graph.Graph; |
||||
import org.springframework.integration.graph.MessageChannelNode; |
||||
import org.springframework.integration.graph.MessageGatewayNode; |
||||
import org.springframework.integration.graph.MessageHandlerNode; |
||||
import org.springframework.integration.graph.MessageProducerNode; |
||||
import org.springframework.integration.graph.MessageSourceNode; |
||||
import org.springframework.integration.graph.PollableChannelNode; |
||||
import org.springframework.integration.graph.RoutingMessageHandlerNode; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link IntegrationGraphEndpointRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class IntegrationGraphEndpointRuntimeHintsTests { |
||||
|
||||
private final IntegrationGraphEndpointRuntimeHints sut = new IntegrationGraphEndpointRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
Set<Class<?>> bindingTypes = Set.of(Graph.class, EndpointNode.class, CompositeMessageHandlerNode.class, |
||||
DiscardingMessageHandlerNode.class, ErrorCapableCompositeMessageHandlerNode.class, |
||||
ErrorCapableDiscardingMessageHandlerNode.class, ErrorCapableEndpointNode.class, |
||||
ErrorCapableMessageHandlerNode.class, ErrorCapableRoutingNode.class, MessageGatewayNode.class, |
||||
MessageProducerNode.class, PollableChannelNode.class, MessageChannelNode.class, |
||||
MessageHandlerNode.class, MessageSourceNode.class, RoutingMessageHandlerNode.class); |
||||
for (Class<?> bindingType : bindingTypes) { |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(bindingType) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS)) |
||||
.accepts(runtimeHints); |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.metrics.cache; |
||||
|
||||
import com.hazelcast.spring.cache.HazelcastCache; |
||||
import io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics; |
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.metrics.cache.HazelcastCacheMeterBinderProvider.HazelcastCacheMeterBinderProviderRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link HazelcastCacheMeterBinderProviderRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class HazelcastCacheMeterBinderProviderRuntimeHintsTests { |
||||
|
||||
private final HazelcastCacheMeterBinderProviderRuntimeHints sut = new HazelcastCacheMeterBinderProviderRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.reflection().onMethod(HazelcastCache.class, "getNativeCache")) |
||||
.accepts(runtimeHints); |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(HazelcastCacheMetrics.class)).accepts(runtimeHints); |
||||
} |
||||
|
||||
} |
||||
@ -1,56 +0,0 @@
@@ -1,56 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.scheduling; |
||||
|
||||
import java.util.Set; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.CronTaskDescription; |
||||
import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.CustomTriggerTaskDescription; |
||||
import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.FixedDelayTaskDescription; |
||||
import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.FixedRateTaskDescription; |
||||
import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.ScheduledTasksEndpointRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link ScheduledTasksEndpointRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class ScheduledTasksEndpointRuntimeHintsTests { |
||||
|
||||
private final ScheduledTasksEndpointRuntimeHints sut = new ScheduledTasksEndpointRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
Set<Class<?>> bindingTypes = Set.of(FixedRateTaskDescription.class, FixedDelayTaskDescription.class, |
||||
CronTaskDescription.class, CustomTriggerTaskDescription.class); |
||||
for (Class<?> bindingType : bindingTypes) { |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(bindingType) |
||||
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS)) |
||||
.accepts(runtimeHints); |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,53 +0,0 @@
@@ -1,53 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.actuate.startup; |
||||
|
||||
import java.util.Set; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.MemberCategory; |
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.TypeReference; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.actuate.startup.StartupEndpoint.StartupEndpointRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link StartupEndpointRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class StartupEndpointRuntimeHintsTests { |
||||
|
||||
private final StartupEndpointRuntimeHints sut = new StartupEndpointRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
Set<TypeReference> bindingTypes = Set.of( |
||||
TypeReference.of("org.springframework.boot.context.metrics.buffering.BufferedStartupStep$DefaultTag"), |
||||
TypeReference.of("org.springframework.core.metrics.jfr.FlightRecorderStartupStep$FlightRecorderTag")); |
||||
for (TypeReference bindingType : bindingTypes) { |
||||
assertThat(RuntimeHintsPredicates.reflection().onType(bindingType) |
||||
.withMemberCategories(MemberCategory.INVOKE_PUBLIC_METHODS)).accepts(runtimeHints); |
||||
} |
||||
} |
||||
|
||||
} |
||||
9
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/reactive/DispatcherHandlersMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/reactive/DispatcherHandlersMappingDescriptionProviderTests.java
9
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/reactive/DispatcherHandlersMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/reactive/DispatcherHandlersMappingDescriptionProviderTests.java
9
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProviderTests.java
9
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProviderTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProviderTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/FiltersMappingDescriptionProviderTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProviderTests.java
8
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProviderRuntimeHintsTests.java → spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/servlet/ServletsMappingDescriptionProviderTests.java
@ -1,44 +0,0 @@
@@ -1,44 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.info; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.info.BuildProperties.BuildPropertiesRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link BuildPropertiesRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class BuildPropertiesRuntimeHintsTests { |
||||
|
||||
private final BuildPropertiesRuntimeHints sut = new BuildPropertiesRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.resource().forResource("META-INF/build-info.properties")) |
||||
.accepts(runtimeHints); |
||||
} |
||||
|
||||
} |
||||
@ -1,43 +0,0 @@
@@ -1,43 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2022 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.info; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.aot.hint.RuntimeHints; |
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
||||
import org.springframework.boot.info.GitProperties.GitPropertiesRuntimeHints; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Tests for {@link GitPropertiesRuntimeHints}. |
||||
* |
||||
* @author Moritz Halbritter |
||||
*/ |
||||
class GitPropertiesRuntimeHintsTests { |
||||
|
||||
private final GitPropertiesRuntimeHints sut = new GitPropertiesRuntimeHints(); |
||||
|
||||
@Test |
||||
void shouldRegisterHints() { |
||||
RuntimeHints runtimeHints = new RuntimeHints(); |
||||
this.sut.registerHints(runtimeHints, getClass().getClassLoader()); |
||||
assertThat(RuntimeHintsPredicates.resource().forResource("git.properties")).accepts(runtimeHints); |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue