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:
Christopher Smith
2014-07-09 19:37:23 -05:00
parent dfa8b87670
commit eb732d792e
7 changed files with 27 additions and 17 deletions

View File

@@ -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

View File

@@ -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;
}