Skip to content

Commit

Permalink
remove boxing
Browse files Browse the repository at this point in the history
  • Loading branch information
clove506 committed Oct 10, 2019
1 parent 2229b8f commit 4b650a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,29 @@ abstract class AbstractDataSourcePoolMetadataTests<D extends AbstractDataSourceP

@Test
void getMaxPoolSize() {
assertThat(getDataSourceMetadata().getMax()).isEqualTo(Integer.valueOf(2));
assertThat(getDataSourceMetadata().getMax()).isEqualTo(2);
}

@Test
void getMinPoolSize() {
assertThat(getDataSourceMetadata().getMin()).isEqualTo(Integer.valueOf(0));
assertThat(getDataSourceMetadata().getMin()).isEqualTo(0);
}

@Test
void getPoolSizeNoConnection() {
// Make sure the pool is initialized
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource());
jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> null);
assertThat(getDataSourceMetadata().getActive()).isEqualTo(Integer.valueOf(0));
assertThat(getDataSourceMetadata().getUsage()).isEqualTo(Float.valueOf(0));
assertThat(getDataSourceMetadata().getActive()).isEqualTo(0);
assertThat(getDataSourceMetadata().getUsage()).isEqualTo((float) 0);
}

@Test
void getPoolSizeOneConnection() {
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource());
jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> {
assertThat(getDataSourceMetadata().getActive()).isEqualTo(Integer.valueOf(1));
assertThat(getDataSourceMetadata().getUsage()).isEqualTo(Float.valueOf(0.5F));
assertThat(getDataSourceMetadata().getActive()).isEqualTo(1);
assertThat(getDataSourceMetadata().getUsage()).isEqualTo(0.5F);
return null;
});
}
Expand All @@ -73,7 +73,7 @@ void getPoolSizeOneConnection() {
void getIdle() {
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSourceMetadata().getDataSource());
jdbcTemplate.execute((ConnectionCallback<Void>) (connection) -> null);
assertThat(getDataSourceMetadata().getIdle()).isEqualTo(Integer.valueOf(1));
assertThat(getDataSourceMetadata().getIdle()).isEqualTo(1);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Integer getMax() {
@Test
void getPoolUsageWithUnlimitedPool() {
DataSourcePoolMetadata unlimitedDataSource = createDataSourceMetadata(0, -1);
assertThat(unlimitedDataSource.getUsage()).isEqualTo(Float.valueOf(-1F));
assertThat(unlimitedDataSource.getUsage()).isEqualTo(-1F);
}

@Override
Expand Down

0 comments on commit 4b650a1

Please sign in to comment.