HikariCpDatasourceAccessor implements DatasourceAccessor { @Override public DataSourceInfo getInfo(final Object resource) throws Exception { DataSourceInfo dataSourceInfo = null; if (canMap(resource)) { HikariDataSource source = (HikariDataSource) resource; MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); ObjectName poolName = new ObjectName("com.zaxxer.hikari:type=Pool (" + source.getPoolName() + ")"); HikariPoolMXBean poolProxy = JMX.newMXBeanProxy(mbeanServer, poolName, HikariPoolMXBean.class); dataSourceInfo = new DataSourceInfo(); dataSourceInfo.setBusyConnections(poolProxy.getActiveConnections()); dataSourceInfo.setEstablishedConnections(poolProxy.getTotalConnections()); dataSourceInfo.setMaxConnections(source.getMaximumPoolSize()); dataSourceInfo.setJdbcUrl(source.getJdbcUrl()); dataSourceInfo.setUsername(source.getUsername()); dataSourceInfo.setResettable(false); dataSourceInfo.setType("hikari"); } return dataSourceInfo; }  @Override DataSourceInfo getInfo(final Object resource); @Override boolean reset(final Object resource); @Override boolean canMap(final Object resource);  }
@Disabled @Test public void getInfoTest() throws Exception { accessor.getInfo(source); }