|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2012-2021 the original author or authors. |
|
|
|
|
* Copyright 2012-2024 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. |
|
|
|
|
@ -21,6 +21,10 @@ import java.time.Duration;
@@ -21,6 +21,10 @@ import java.time.Duration;
|
|
|
|
|
import io.micrometer.core.instrument.Meter.Type; |
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
|
|
import org.springframework.aot.hint.RuntimeHints; |
|
|
|
|
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; |
|
|
|
|
import org.springframework.util.ReflectionUtils; |
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -73,4 +77,16 @@ class ServiceLevelObjectiveBoundaryTests {
@@ -73,4 +77,16 @@ class ServiceLevelObjectiveBoundaryTests {
|
|
|
|
|
assertThat(slo.getValue(Type.DISTRIBUTION_SUMMARY)).isNull(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void shouldRegisterRuntimeHints() { |
|
|
|
|
RuntimeHints runtimeHints = new RuntimeHints(); |
|
|
|
|
new ServiceLevelObjectiveBoundary.ServiceLevelObjectiveBoundaryHints().registerHints(runtimeHints, |
|
|
|
|
getClass().getClassLoader()); |
|
|
|
|
ReflectionUtils.doWithLocalMethods(ServiceLevelObjectiveBoundary.class, (method) -> { |
|
|
|
|
if ("valueOf".equals(method.getName())) { |
|
|
|
|
assertThat(RuntimeHintsPredicates.reflection().onMethod(method)).accepts(runtimeHints); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|