|
|
@ -16,17 +16,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.autoconfigure.jdbc;
|
|
|
|
package org.springframework.boot.autoconfigure.jdbc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertNotNull;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertNull;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
|
|
|
|
|
|
|
|
import java.sql.Connection;
|
|
|
|
import java.sql.Connection;
|
|
|
|
import java.sql.Driver;
|
|
|
|
import java.sql.Driver;
|
|
|
|
import java.sql.DriverPropertyInfo;
|
|
|
|
import java.sql.DriverPropertyInfo;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
|
|
|
import java.sql.SQLFeatureNotSupportedException;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.dbcp.BasicDataSource;
|
|
|
|
import org.apache.commons.dbcp.BasicDataSource;
|
|
|
|
|
|
|
|
import org.junit.Ignore;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.mockito.Mockito;
|
|
|
|
import org.mockito.Mockito;
|
|
|
|
import org.springframework.boot.TestUtils;
|
|
|
|
import org.springframework.boot.TestUtils;
|
|
|
@ -40,10 +48,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
|
|
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertNotNull;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertNull;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tests for {@link DataSourceAutoConfiguration}.
|
|
|
|
* Tests for {@link DataSourceAutoConfiguration}.
|
|
|
@ -78,6 +82,7 @@ public class DataSourceAutoConfigurationTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
public void testExplicitDriverClassClearsUserName() throws Exception {
|
|
|
|
public void testExplicitDriverClassClearsUserName() throws Exception {
|
|
|
|
TestUtils
|
|
|
|
TestUtils
|
|
|
|
.addEnviroment(
|
|
|
|
.addEnviroment(
|
|
|
@ -240,6 +245,10 @@ public class DataSourceAutoConfigurationTests {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
|
|
|
|
|
|
|
|
return Mockito.mock(Logger.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|