From c989470f94926ee5c7474bead278b00e9aaac787 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 25 Oct 2021 17:12:55 +0200 Subject: [PATCH] Remove unused code in FormattingConversionServiceTests This commit removes test code that became obsolete with the removal of Joda Time support. --- .../FormattingConversionServiceTests.java | 92 ------------------- 1 file changed, 92 deletions(-) diff --git a/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java b/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java index 07cc3ecffcd..00a56960ef0 100644 --- a/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java +++ b/spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java @@ -16,10 +16,6 @@ package org.springframework.format.support; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.util.Date; -import java.util.List; import java.util.Locale; import org.junit.jupiter.api.AfterEach; @@ -27,7 +23,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.aop.framework.ProxyFactory; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.core.convert.ConversionFailedException; import org.springframework.core.convert.TypeDescriptor; @@ -35,7 +30,6 @@ import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.ConverterFactory; import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.format.Formatter; -import org.springframework.format.annotation.NumberFormat; import org.springframework.format.number.NumberStyleFormatter; import static org.assertj.core.api.Assertions.assertThat; @@ -187,80 +181,6 @@ public class FormattingConversionServiceTests { } - public static class ValueBean { - - @Value("10-31-09") - @org.springframework.format.annotation.DateTimeFormat(pattern="MM-d-yy") - public Date date; - } - - - public static class MetaValueBean { - - @MyDateAnn - public Date date; - - @MyNumberAnn - public Double number; - } - - - @Value("${myDate}") - @org.springframework.format.annotation.DateTimeFormat(pattern="MM-d-yy") - @Retention(RetentionPolicy.RUNTIME) - public @interface MyDateAnn { - } - - - @Value("${myNumber}") - @NumberFormat(style = NumberFormat.Style.PERCENT) - @Retention(RetentionPolicy.RUNTIME) - public @interface MyNumberAnn { - } - - - public static class Model { - - @org.springframework.format.annotation.DateTimeFormat(style="S-") - public Date date; - - @org.springframework.format.annotation.DateTimeFormat(pattern="M-d-yy") - public List dates; - - public List getDates() { - return dates; - } - - public void setDates(List dates) { - this.dates = dates; - } - } - - - public static class ModelWithPlaceholders { - - @org.springframework.format.annotation.DateTimeFormat(style="${dateStyle}") - public Date date; - - @MyDatePattern - public List dates; - - public List getDates() { - return dates; - } - - public void setDates(List dates) { - this.dates = dates; - } - } - - - @org.springframework.format.annotation.DateTimeFormat(pattern="${datePattern}") - @Retention(RetentionPolicy.RUNTIME) - public @interface MyDatePattern { - } - - public static class NullReturningFormatter implements Formatter { @Override @@ -275,18 +195,6 @@ public class FormattingConversionServiceTests { } - @SuppressWarnings("serial") - public static class MyDate extends Date { - } - - - private static class ModelWithSubclassField { - - @org.springframework.format.annotation.DateTimeFormat(style = "S-") - public MyDate date; - } - - private static class IntegerConverter implements Converter { @Override