Merge branch '6.0.x'

This commit is contained in:
Sam Brannen 2023-07-11 15:41:51 +02:00
commit 8448f597b1
2 changed files with 6 additions and 10 deletions

View File

@ -88,12 +88,6 @@ public abstract class AnnotationConfigUtils {
public static final String COMMON_ANNOTATION_PROCESSOR_BEAN_NAME =
"org.springframework.context.annotation.internalCommonAnnotationProcessor";
/**
* The bean name of the internally managed JSR-250 annotation processor.
*/
private static final String JSR250_ANNOTATION_PROCESSOR_BEAN_NAME =
"org.springframework.context.annotation.internalJsr250AnnotationProcessor";
/**
* The bean name of the internally managed JPA annotation processor.
*/

View File

@ -463,7 +463,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
*/
@Test
void setAutodetectModeToAllSupportedValues() {
streamConstants(MBeanExporter.class)
streamAutodetectConstants()
.map(MBeanExporterTests::getFieldValue)
.forEach(mode -> assertThatNoException().isThrownBy(() -> exporter.setAutodetectMode(mode)));
}
@ -512,7 +512,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
*/
@Test
void setAutodetectModeNameToAllSupportedValues() {
streamConstants(MBeanExporter.class)
streamAutodetectConstants()
.map(Field::getName)
.forEach(name -> assertThatNoException().isThrownBy(() -> exporter.setAutodetectModeName(name)));
}
@ -703,8 +703,10 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
}
}
private static Stream<Field> streamConstants(Class<?> clazz) {
return Arrays.stream(clazz.getFields()).filter(ReflectionUtils::isPublicStaticFinal);
private static Stream<Field> streamAutodetectConstants() {
return Arrays.stream(MBeanExporter.class.getFields())
.filter(ReflectionUtils::isPublicStaticFinal)
.filter(field -> field.getName().startsWith("AUTODETECT_"));
}
private static Integer getFieldValue(Field field) {