diff --git a/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java b/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java index 799626afd1b..97547e824b9 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java @@ -187,12 +187,12 @@ public abstract class AbstractMethodMetadataTests { } @Test - void isStatusWhenStaticReturnsTrue() { + void isStaticWhenStaticReturnsTrue() { assertThat(getTagged(WithStaticMethod.class).isStatic()).isTrue(); } @Test - void isStaticWhenNotStaticReturnsFalse() { + void isStaticWhenNonStaticReturnsFalse() { assertThat(getTagged(WithMethod.class).isStatic()).isFalse(); } @@ -248,7 +248,9 @@ public abstract class AbstractMethodMetadataTests { void getAnnotationAttributesReturnsAttributes() { Map attributes = getTagged(WithAnnotationAttributes.class) .getAnnotationAttributes(AnnotationAttributes.class.getName()); - assertThat(attributes).containsOnly(entry("name", "test"), entry("size", 1)); + // We do not use containsExactlyInAnyOrder(), because annotations + // must be returned in source declaration order. + assertThat(attributes).containsExactly(entry("name", "test"), entry("size", 1)); } @Test