pull up Postgres URI schema, split out JDBC URL types--this should
probably be done in the interface instead of ad-hocky
This commit is contained in:
@@ -3,14 +3,14 @@ package org.springframework.cloud.cloudfoundry;
|
||||
import org.springframework.cloud.service.common.PostgresqlServiceInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Ramnivas Laddad
|
||||
*
|
||||
*/
|
||||
public class PostgresqlServiceInfoCreator extends RelationalServiceInfoCreator<PostgresqlServiceInfo> {
|
||||
|
||||
public PostgresqlServiceInfoCreator() {
|
||||
super(new Tags("postgresql"), "postgres");
|
||||
super(new Tags("postgresql"), PostgresqlServiceInfo.URI_SCHEMA);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.springframework.cloud.cloudfoundry;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Ramnivas Laddad
|
||||
*
|
||||
*/
|
||||
@@ -20,12 +20,13 @@ public abstract class AbstractCloudFoundryConnectorRelationalServiceTest extends
|
||||
}
|
||||
|
||||
protected static String getJdbcUrl(String databaseType, String name) {
|
||||
// this should be cleaned up more broadly; pull into RelationalServiceInfo interface?
|
||||
String jdbcUrlDatabaseType = databaseType;
|
||||
if (databaseType.equals("postgres")) {
|
||||
jdbcUrlDatabaseType = "postgresql";
|
||||
}
|
||||
|
||||
return "jdbc:" + jdbcUrlDatabaseType + "://" + hostname + ":" + port + "/" + name +
|
||||
return "jdbc:" + jdbcUrlDatabaseType + "://" + hostname + ":" + port + "/" + name +
|
||||
"?user=" + username + "&password=" + password;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user