diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfigurationTests.java index 523dae6b99..bb74eb23ef 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfigurationTests.java @@ -16,8 +16,6 @@ package org.springframework.boot.autoconfigure.jdbc; -import java.lang.reflect.Field; - import javax.sql.DataSource; import com.zaxxer.hikari.HikariDataSource; @@ -25,7 +23,6 @@ import org.junit.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; -import org.springframework.util.ReflectionUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -105,11 +102,4 @@ public class HikariDataSourceConfigurationTests { }); } - @SuppressWarnings("unchecked") - public static T getField(Class target, String name) { - Field field = ReflectionUtils.findField(target, name, null); - ReflectionUtils.makeAccessible(field); - return (T) ReflectionUtils.getField(field, target); - } - } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java index a268f64229..6d13593bbc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ package org.springframework.boot.autoconfigure.jdbc; -import java.lang.reflect.Field; - import javax.sql.DataSource; import org.apache.tomcat.jdbc.pool.DataSourceProxy; @@ -34,7 +32,6 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableMBeanExport; -import org.springframework.util.ReflectionUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -115,13 +112,6 @@ public class TomcatDataSourceConfigurationTests { assertThat(ds.getValidationInterval()).isEqualTo(3000L); } - @SuppressWarnings("unchecked") - public static T getField(Class target, String name) { - Field field = ReflectionUtils.findField(target, name, null); - ReflectionUtils.makeAccessible(field); - return (T) ReflectionUtils.getField(field, target); - } - @Configuration @EnableConfigurationProperties @EnableMBeanExport