Clean up warnings in Gradle build

This commit is contained in:
Sam Brannen
2024-12-19 14:48:33 +01:00
parent ef06bf4e74
commit 62d9600cdd
2 changed files with 12 additions and 11 deletions

View File

@@ -47,7 +47,6 @@ import org.springframework.core.annotation.AnnotationUtilsTests.WebController;
import org.springframework.core.annotation.AnnotationUtilsTests.WebMapping;
import org.springframework.core.testfixture.stereotype.Component;
import org.springframework.core.testfixture.stereotype.Indexed;
import org.springframework.lang.NonNullApi;
import org.springframework.util.MultiValueMap;
import static java.util.Arrays.asList;
@@ -237,10 +236,11 @@ class AnnotatedElementUtilsTests {
}
@Test
@SuppressWarnings("deprecation")
void isAnnotatedForPlainTypes() {
assertThat(isAnnotated(Order.class, Documented.class)).isTrue();
assertThat(isAnnotated(NonNullApi.class, Documented.class)).isTrue();
assertThat(isAnnotated(NonNullApi.class, Nonnull.class)).isTrue();
assertThat(isAnnotated(org.springframework.lang.NonNullApi.class, Documented.class)).isTrue();
assertThat(isAnnotated(org.springframework.lang.NonNullApi.class, Nonnull.class)).isTrue();
assertThat(isAnnotated(ParametersAreNonnullByDefault.class, Nonnull.class)).isTrue();
}
@@ -277,10 +277,11 @@ class AnnotatedElementUtilsTests {
}
@Test
@SuppressWarnings("deprecation")
void hasAnnotationForPlainTypes() {
assertThat(hasAnnotation(Order.class, Documented.class)).isTrue();
assertThat(hasAnnotation(NonNullApi.class, Documented.class)).isTrue();
assertThat(hasAnnotation(NonNullApi.class, Nonnull.class)).isTrue();
assertThat(hasAnnotation(org.springframework.lang.NonNullApi.class, Documented.class)).isTrue();
assertThat(hasAnnotation(org.springframework.lang.NonNullApi.class, Nonnull.class)).isTrue();
assertThat(hasAnnotation(ParametersAreNonnullByDefault.class, Nonnull.class)).isTrue();
}
@@ -344,9 +345,10 @@ class AnnotatedElementUtilsTests {
}
@Test
@SuppressWarnings("deprecation")
void getAllAnnotationAttributesOnLangType() {
MultiValueMap<String, Object> attributes = getAllAnnotationAttributes(
NonNullApi.class, Nonnull.class.getName());
org.springframework.lang.NonNullApi.class, Nonnull.class.getName());
assertThat(attributes).as("Annotation attributes map for @Nonnull on NonNullApi").isNotNull();
assertThat(attributes.get("when")).as("value for NonNullApi").isEqualTo(List.of(When.ALWAYS));
}