class HibernateDatabaseInfoProvider implements DatabaseInfoProvider {

    @PostConstruct
    public void init()
    {
        checkDatabaseConnectivity();

        boolean spatialSupport = false;

        // Check if postgis is installed, fail startup if not

        if ( !SystemUtils.isTestRun(environment.getActiveProfiles()) )
        {
            spatialSupport = isSpatialSupport();

            if ( !spatialSupport )
            {
                log.error( POSTGIS_MISSING_ERROR );
                throw new IllegalStateException( POSTGIS_MISSING_ERROR );
            }
        }

        String url = config.getProperty( ConfigurationKey.CONNECTION_URL );
        String user = config.getProperty( ConfigurationKey.CONNECTION_USERNAME );
        String password = config.getProperty( ConfigurationKey.CONNECTION_PASSWORD );
        InternalDatabaseInfo internalDatabaseInfo = getInternalDatabaseInfo();

        info = new DatabaseInfo();
        info.setName( internalDatabaseInfo.getDatabase() );
        info.setUser( StringUtils.defaultIfEmpty( internalDatabaseInfo.getUser(), user ) );
        info.setPassword( password );
        info.setUrl( url );
        info.setSpatialSupport( spatialSupport );
        info.setDatabaseVersion( internalDatabaseInfo.getVersion() );
    }

    public  HibernateDatabaseInfoProvider( DhisConfigurationProvider config, JdbcOperations jdbcTemplate,
        Environment environment );

}