Clean up warnings in Gradle build
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -2905,7 +2905,7 @@ class ServletAnnotationControllerHandlerMethodTests extends AbstractServletHandl
|
||||
tb = (TestBean) model.get("myCommand");
|
||||
}
|
||||
if (tb.getName() != null && tb.getName().endsWith("myDefaultName")) {
|
||||
assertThat(tb.getDate().getYear()).isEqualTo(107);
|
||||
assertThat(tb.getDate()).hasYear(2007);
|
||||
}
|
||||
Errors errors = (Errors) model.get(BindingResult.MODEL_KEY_PREFIX + "testBean");
|
||||
if (errors == null) {
|
||||
@@ -2915,8 +2915,7 @@ class ServletAnnotationControllerHandlerMethodTests extends AbstractServletHandl
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
if (model.containsKey("ITestBean")) {
|
||||
boolean condition = model.get(BindingResult.MODEL_KEY_PREFIX + "ITestBean") instanceof Errors;
|
||||
assertThat(condition).isTrue();
|
||||
assertThat(model.get(BindingResult.MODEL_KEY_PREFIX + "ITestBean")).isInstanceOf(Errors.class);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
List<TestBean> testBeans = (List<TestBean>) model.get("testBeanList");
|
||||
@@ -2939,8 +2938,8 @@ class ServletAnnotationControllerHandlerMethodTests extends AbstractServletHandl
|
||||
@Override
|
||||
public View resolveViewName(String viewName, Locale locale) {
|
||||
return (model, request, response) -> {
|
||||
request.setAttribute("viewName", viewName);
|
||||
request.getSession().setAttribute("model", model);
|
||||
request.setAttribute("viewName", viewName);
|
||||
request.getSession().setAttribute("model", model);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user