Skip to content

Commit

Permalink
Upgrade to Commons DBCP2 2.11.0
Browse files Browse the repository at this point in the history
Closes gh-39002
  • Loading branch information
wilkinsona committed Jan 4, 2024
1 parent 93025a0 commit 6bd042e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
Expand Down Expand Up @@ -267,8 +267,8 @@ void dbcp2UsesCustomConnectionDetailsWhenDefined() {
DataSource dataSource = context.getBean(DataSource.class);
assertThat(dataSource).asInstanceOf(InstanceOfAssertFactories.type(BasicDataSource.class))
.satisfies((dbcp2) -> {
assertThat(dbcp2.getUsername()).isEqualTo("user-1");
assertThat(dbcp2.getPassword()).isEqualTo("password-1");
assertThat(dbcp2.getUserName()).isEqualTo("user-1");
assertThat(dbcp2).extracting("password").isEqualTo("password-1");
assertThat(dbcp2.getDriverClassName()).isEqualTo(DatabaseDriver.POSTGRESQL.getDriverClassName());
assertThat(dbcp2.getUrl()).isEqualTo("jdbc:customdb://customdb.example.com:12345/database-1");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void setUsernamePasswordUrlAndDriverClassName() {
new Dbcp2JdbcConnectionDetailsBeanPostProcessor(null).processDataSource(dataSource,
new TestJdbcConnectionDetails());
assertThat(dataSource.getUrl()).isEqualTo("jdbc:customdb://customdb.example.com:12345/database-1");
assertThat(dataSource.getUsername()).isEqualTo("user-1");
assertThat(dataSource.getPassword()).isEqualTo("password-1");
assertThat(dataSource.getUserName()).isEqualTo("user-1");
assertThat(dataSource).extracting("password").isEqualTo("password-1");
assertThat(dataSource.getDriverClassName()).isEqualTo(DatabaseDriver.POSTGRESQL.getDriverClassName());
}

Expand Down
2 changes: 1 addition & 1 deletion spring-boot-project/spring-boot-dependencies/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ bom {
]
}
}
library("Commons DBCP2", "2.10.0") {
library("Commons DBCP2", "2.11.0") {
group("org.apache.commons") {
modules = [
"commons-dbcp2" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ private static class MappedDbcp2DataSource extends MappedDataSourceProperties<Ba
add(DataSourceProperty.URL, BasicDataSource::getUrl, BasicDataSource::setUrl);
add(DataSourceProperty.DRIVER_CLASS_NAME, BasicDataSource::getDriverClassName,
BasicDataSource::setDriverClassName);
add(DataSourceProperty.USERNAME, BasicDataSource::getUsername, BasicDataSource::setUsername);
add(DataSourceProperty.PASSWORD, BasicDataSource::getPassword, BasicDataSource::setPassword);
add(DataSourceProperty.USERNAME, BasicDataSource::getUserName, BasicDataSource::setUsername);
add(DataSourceProperty.PASSWORD, null, BasicDataSource::setPassword);
}

}
Expand Down

0 comments on commit 6bd042e

Please sign in to comment.