diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java index 99b6ae3f6f8..ec7f13a2833 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Set; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionFailedException; @@ -61,11 +62,16 @@ * @author Phillip Webb * @author David Haraburda * @author Sam Brannen + * @author Yanming Zhou */ class GenericConversionServiceTests { - private final GenericConversionService conversionService = new GenericConversionService(); + private GenericConversionService conversionService; + @BeforeEach + void init() { + conversionService = new GenericConversionService(); + } @Test void canConvert() {