Remove boxing

See gh-18552
pull/18564/head
clove506 5 years ago committed by Stephane Nicoll
parent e9892be4ee
commit fe6da39e1b

@ -42,12 +42,12 @@ abstract class AbstractDataSourcePoolMetadataTests<D extends AbstractDataSourceP
@Test @Test
void getMaxPoolSize() { void getMaxPoolSize() {
assertThat(getDataSourceMetadata().getMax()).isEqualTo(Integer.valueOf(2)); assertThat(getDataSourceMetadata().getMax()).isEqualTo(2);
} }
@Test @Test
void getMinPoolSize() { void getMinPoolSize() {
assertThat(getDataSourceMetadata().getMin()).isEqualTo(Integer.valueOf(0)); assertThat(getDataSourceMetadata().getMin()).isEqualTo(0);
} }
@Test @Test
@ -55,16 +55,16 @@ abstract class AbstractDataSourcePoolMetadataTests<D extends AbstractDataSourceP
// Make sure the pool is initialized // Make sure the pool is initialized
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource()); JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource());
jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> null); jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> null);
assertThat(getDataSourceMetadata().getActive()).isEqualTo(Integer.valueOf(0)); assertThat(getDataSourceMetadata().getActive()).isEqualTo(0);
assertThat(getDataSourceMetadata().getUsage()).isEqualTo(Float.valueOf(0)); assertThat(getDataSourceMetadata().getUsage()).isEqualTo((float) 0);
} }
@Test @Test
void getPoolSizeOneConnection() { void getPoolSizeOneConnection() {
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource()); JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource());
jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> { jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> {
assertThat(getDataSourceMetadata().getActive()).isEqualTo(Integer.valueOf(1)); assertThat(getDataSourceMetadata().getActive()).isEqualTo(1);
assertThat(getDataSourceMetadata().getUsage()).isEqualTo(Float.valueOf(0.5F)); assertThat(getDataSourceMetadata().getUsage()).isEqualTo(0.5F);
return null; return null;
}); });
} }
@ -73,7 +73,7 @@ abstract class AbstractDataSourcePoolMetadataTests<D extends AbstractDataSourceP
void getIdle() { void getIdle() {
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource()); JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource());
jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> null); jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> null);
assertThat(getDataSourceMetadata().getIdle()).isEqualTo(Integer.valueOf(1)); assertThat(getDataSourceMetadata().getIdle()).isEqualTo(1);
} }
@Test @Test

@ -61,7 +61,7 @@ class CommonsDbcp2DataSourcePoolMetadataTests
@Test @Test
void getPoolUsageWithUnlimitedPool() { void getPoolUsageWithUnlimitedPool() {
DataSourcePoolMetadata unlimitedDataSource = createDataSourceMetadata(0, -1); DataSourcePoolMetadata unlimitedDataSource = createDataSourceMetadata(0, -1);
assertThat(unlimitedDataSource.getUsage()).isEqualTo(Float.valueOf(-1F)); assertThat(unlimitedDataSource.getUsage()).isEqualTo(-1F);
} }
@Override @Override

Loading…
Cancel
Save