Class PostgresITDataSource.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • fromProperty

        public PostgresITDataSource.Builder fromProperty​(String databaseName,
                                                         String portPropertyName)
        Set database name and port property

        Remember to export port using the maven-failsafe-plugin plugin

        Parameters:
        databaseName - name of database
        portPropertyName - name of system property containing port
        Returns:
        self
      • fromProperty

        public PostgresITDataSource.Builder fromProperty​(String databaseName)
        Set database name, take port from postgresql.${name}.port property

        Remember to export port using the maven-failsafe-plugin plugin

        Parameters:
        databaseName - name of database
        Returns:
        self
      • fromEnvironment

        public PostgresITDataSource.Builder fromEnvironment​(String environmentName)
        Search environment variable for database location

        Environment variable should contain a uri with:

        • no schema or schema 'postgres' or 'postgresql'
        • user
        • password
        • hostname
        • port (optional defaults to 5432)
        • database
        Parameters:
        environmentName - name if environment variable to examine
        Returns:
        self
      • withFallback

        public PostgresITDataSource.Builder withFallback()
        Allow use of $PG* environment variables for database discovery
        • user is $PGUSER or ${user.name}
        • password is $PGPASSWORD or ${user.name}
        • host is $PGHOST or 127.0.0.1
        • port is $PGPORT or 5432
        • database is $PGDATABASE or ${user.name}
        Returns:
        self